• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Spring MVC: Control going out of webapplication when submitting form

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
On top of spaghetti all covered in cheese, there was this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!