• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Customizing 404 error messages in Struts

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am using form-based authentication in my Struts-based application.I am encountering some problem in my application.Normally,a user logins to the application.But,on login,if he tries to go back to the login page again using the browser "Back" button and if he logins again,he is presented with a "HTTP Status 404" error page from the server stating that a invalid direct reference has been made to the login page or the requested resource(/application name/j_security_check) is not available.This is due to the fact that the user has already logged in to the application but is trying to login again.I want to customize the 404 server error message page so that the user is informed about the error in a more friendly way.
I want to know how to solve this problem.If there is any example code to overcome this problem,it would be very much easier for me to solve my problem.Waiting for a positive response.Thank in advance.
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I dont have much idea. But in the Orelly's struts book(Prgramming Jakarta Struts) they have given some code part for configuring Error handling in web.xml
The following code part they have given as an example to prevent users from seeing 404 or 500 (internal server)error
<web-app>
other elements
<error-page>
<error-code>404</error-code>
<location>/common/404.jsp</location>
</error-page>
</web-app>
When an error status code is set in the response , the container consults the list of error page declarations for the web application. If the match found, the container returns the recource indicated by the location element.
the value of the location element muct begin with a "/" character and it must refer to a recource within the web application
This is the explanation they gave in the book
For more detailed explanation you can go through that book
try
all the best
Poornima
 
I brought this back from the farm where they grow the tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic