All, this the relevant code from my login page:
and the controller:Code:<form:form target="login.do" method="post"> <span style="font-size:77%;"> <label>email:</label> <form:input path="userName" cssClass="textfield" cssStyle="width:160px;" title="user name" name="userName" type="text" /> <label>password:</label> <form:input path="password" cssClass="textfield" cssStyle="width:160px;" name="password" type="password" /> <input value="Login" class="button" type="submit" style="margin-bottom:4px" /> </span> </form:form>
now, I'm obviously not done with the implementation here, but I can't even get the simple code included to work (just printing out parameter), it throws an exception: "java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'command' available as request attribute" when I navigate to the page by going to the /login URL, which is odd, because I'm not even using the form at that point, I'm just going to the page with the form on itCode:@Controller public class LoginController { @RequestMapping(value = "/login") public String login() { System.out.println("login"); return "login"; } @RequestMapping(value="/login.do", method=RequestMethod.POST) public String doLogin(@RequestParam String userName, @RequestParam String password) { System.out.println(userName); System.out.println(password); System.out.println("doLogin"); return "login"; } }
so I have several questions:
1. how do I get my specific example to work
2. for my simple uses do I even need to use <form:form> tags, or can I just use a regular form?
3. this page will have another form on it as well, is there further considerations that I need to have because of that?
4. does anyone have a good spring 3 book to recommend?


Reply With Quote