• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Customizing 404 error messages in Struts

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
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
other elements
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
all the best
    Bookmark Topic Watch Topic
  • New Topic