Results 1 to 6 of 6

Thread: how to use submit?

  1. #1
    Join Date
    Sep 2008
    Posts
    17

    Default how to use submit?

    How can I create a button to submit that once clicked send me to another page.
    Someone can give me an example?

  2. #2
    Join Date
    Dec 2007
    Location
    Kerala, India
    Posts
    66

    Default

    Code:
    import org.springframework.web.servlet.mvc.SimpleFormController;
    
    public class LoginController extends SimpleFormController {
    
         @Override
        public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
                throws ServletException, IOException {
    // u r logic goes here
    }
    Nidhin

  3. #3
    Join Date
    Sep 2008
    Posts
    17

    Default

    Quote Originally Posted by nidhin View Post
    Code:
    import org.springframework.web.servlet.mvc.SimpleFormController;
    
    public class LoginController extends SimpleFormController {
    
         @Override
        public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
                throws ServletException, IOException {
    // u r logic goes here
    }
    Ok, but how do I manage to file xml??

  4. #4
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    314

    Default

    See the examples which ships with Spring release. They are really good examples to start from.
    if a trainstation is where the train stops, what's a workstation...

  5. #5
    Join Date
    Apr 2006
    Location
    London
    Posts
    82

    Default

    Hangon, you've not said if this is actually going to be form that accepts user info. If it is just a button (instead of a text link) that takes you to another page you can always use <button onClick="""> and then put some javascript into the onClick, it does not have to post to a spring controller.

  6. #6
    Join Date
    Sep 2008
    Posts
    17

    Default

    Quote Originally Posted by nidhin View Post
    Code:
    import org.springframework.web.servlet.mvc.SimpleFormController;
    
    public class LoginController extends SimpleFormController {
    
         @Override
        public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
                throws ServletException, IOException {
    // u r logic goes here
    }
    Ok, but how to recover the data submit?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •