Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic