• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring MVC: Control going out of webapplication when submitting form

 
Dinesh Kumar Y
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]
 
Prasad Krishnegowda
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?
 
See where your hand is? Not there. It's next to this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic