• 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 3.0: Login Page problem

 
Ranch Hand
Posts: 53
  • 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, I am trying to create a login page with the usage of spring form tags and annotations. But I am getting an error as follows



Here is the code I am trying to use

1. homepage.jsp



2. HMSWelcomeController.java


3. UserForm.java


3. HMSProject-servlet.xml



What I am trying to achieve is on run, the first page that should come is the login page that should be bound to the UserForm, which validates the data against a database and allows the user to login.
Can anyone please tell me what I am missing or where I am going wrong

Please help
 
Ranch Hand
Posts: 176
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You are attempting to send your from to /signin.

You need to have a method in your controller that will map to that. eg:

 
Dilip H Pashupathi
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I tried that too. But problem is that I the login page is the initial page where the form elements are available in the Users class. but problem is the code

is unable to look up for the data. I researched through google and found out that modelAttribute parameter associated with the form was not initialized. What I want to know is that is it required that the landing page should be associated with any bean class?

if the form tag is written as follows

is it required that user attribute be initialized with some values? Because this login page is the initial page only after the user provides some input the data will not be initialized. If spring container takes care of initialization then why this error is coming?

and when i removed the


code and replaced it with normal html text box as inputs, the page opened and i was able to perform login validation through internal coding. This takes away the spring feature and makes it look like tight coupled application.

Regards
Dilip HP
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic