This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Struts1 - how to print message if username and passowrd is incorrect

Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All...

Struts1- After submitting username and password, if it is incorrect i want to print a message that "your username or password is incorrect" in a login page itself.

Note: I don't want to use scriplets.
Is there any other alternative(with struts tag)??

My control flows like this...

login page -> Action Form -> Action (Here i am checking userName and Password) (If wrong then redirect to login page with a message )

I can't use <bean:write> tag because at first time My ActionForm object has not created.

Please give me the Solution.

Ankit Maini
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just set a attribute when the username and password is not available or other-words login failure. just get that attribute in a request attribute in jsp and change it to a string. pass that string to a javasctipt and when its failure it will show the message. try it and if any doubt regarding it let me know
We noticed he had no friends. So we gave him this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic