Announcement Announcement Module
Collapse
No announcement yet.
how to use submit? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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
    }

    Comment


    • #3
      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??

      Comment


      • #4
        See the examples which ships with Spring release. They are really good examples to start from.

        Comment


        • #5
          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.

          Comment


          • #6
            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?

            Comment

            Working...
            X