• 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
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

j_security_check - Invalid username or password message

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm using j_security_check in my web application deployed on jboss3.0.4-tomcat4.1.12. On a successful login, the user is redirected to the protected resource. On an invalid login, I'd like a message displayed on the login.jsp. The login.jsp is both my login page and error page.
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/jsp/login.jsp</form-login-page>
<form-error-page>/jsp/login.jsp</form-error-page>
</form-login-config>
</login-config>
Thanks,
John
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pass a query paramter to the failed page say failed=true as shown below

Check for failed=true in the jsp and display the error message.
 
John Fairbairn
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perfect. Can't believe I didn't think of it. Thanks.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi pradip,

i am still confused about form auth, using j_security_check after succefull login how web server know which is home page i mean which do we hv any thing where we can specify home page.

Thanks & Regards
Abhijeet
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To extend this question further...
I wonder if Tomcat/JBoss provide a way to pass actual reason/root cause behind the failure to the login JSP as a param. For our internal/ad hoc system this is desired.

Thanks,





Originally posted by abhijit deshmukh:
hi pradip,

i am still confused about form auth, using j_security_check after succefull login how web server know which is home page i mean which do we hv any thing where we can specify home page.

Thanks & Regards
Abhijeet

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What other reasons might that be? The authentication simply checks that the username/password combination passed to the server exist. If it doesn't, the error page is shown. Are you thinking of conditions like "user database not accessible" ?
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is working okay. But when the user refreshes the page without filling any data then also the error page gets called and the error message is displayed...Please help
 
PrachiS Shah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pradeep bhatt wrote:Pass a query paramter to the failed page say failed=true as shown below

Check for failed=true in the jsp and display the error message.



This is working okay. But when the user refreshes the page without filling any data then also the error page gets called and the error message is displayed...Please help
 
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic