Announcement Announcement Module
Collapse
No announcement yet.
A simple question about MVC Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • A simple question about MVC

    Hi all,

    I try to use the Spring MVC in my program but face some problem.

    My code look as follow:

    My.jsp
    Code:
    ...
    <form:form method="post" action="example.html" commandName="update">
    	<input id="who" type="text" value="test"/>
    	<input type="submit" value="Excecute"/>
    </form:form>
    ...
    And the controller looks as follow:
    Code:
    ...
    public class MyViewController extends ParameterizableViewController {
    	@Override
    	public ModelAndView handleRequest(HttpServletRequest request,
    			HttpServletResponse response) throws Exception {
    		String who = ServletRequestUtils.getStringParameter(request, "who");
    		
    		return super.handleRequest(request, response);
    	}
    }
    ...
    As I click the button "Excecute", the program will run into the controller. But I can't get any value to the who.

    Maybe my code is wrong?

  • #2
    Please post the relevant part of your dispatcher servlet XML configuration.

    Comment


    • #3
      I solved the problem now.

      Comment

      Working...
      X