• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Spring MVC: Control going out of webapplication when submitting form

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am new to Spring MVC and am trying to create a simple website where a user logs in and in turn is shown a dummy page. The control goes to the login page but when I submit the form the control seems to go outside the web application. What am I doing wrong?

web.xml

BankApp-servlet.xml


BankLoginController.java


login.jsp
login.JPG
[Thumbnail for login.JPG]
main.JPG
[Thumbnail for main.JPG]
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, why would you go with a lower version of spring, SimpleFormControllers and other controllers were deprecated from Spring 3.0 in favor of annotated controllers, your controllers should not extend any classes, use annotations, why learn the old way of doing things, start with the better ways to do. I would higly encourage you to start with annotation controllers.

Regarding, the problem, You have just handleRequest overridden, which submits both your POST and GET methods to that method.
Override showForm for get and onSubmit for POST.

I see onSubmit commented, was the screenshot you have shown us taken with the commented onSubmit method or not?
 
reply
    Bookmark Topic Watch Topic
  • New Topic