Win a copy of Head First Android this week in the Android 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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: 8944
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: 43027
76
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic