Results 1 to 10 of 14

Thread: How To Redirect 403 Response To Friendly Page

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    8

    Default How To Redirect 403 Response To Friendly Page

    Hi,

    Not sure if anyone has done this, but is it possible to redirect the 403 thrown by acegi to a customised page? Does anyone have a solution?

    Regards

  2. #2
    Join Date
    Aug 2004
    Location
    New York
    Posts
    168

    Default

    In the web.xml, you can define an error page based on the error-code element. This documentation is from BEA, but it's the same for all servlet containers.

    http://e-docs.bea.com/wls/docs81/web...l.html#1017571
    Karl Baum
    weblog: www.jroller.com/page/kbaum

  3. #3
    Join Date
    Oct 2005
    Posts
    8

    Default

    Thanks Karl,

    did do this:
    <error-page>
    <error-code>403</error-code>
    <location>403.jsp</location>
    </error-page>

    but it never worked..

  4. #4
    Join Date
    Aug 2004
    Location
    New York
    Posts
    168

    Default

    Hmmmm... what page did you get when you tried that?
    Karl Baum
    weblog: www.jroller.com/page/kbaum

  5. #5
    Join Date
    Aug 2004
    Location
    New York
    Posts
    168

    Default

    Just looked in one of my old projects. You may be missing a forward slash if the 403.jsp is in the root of your webapp.

    <error-page>
    <error-code>403</error-code>
    <location>/403.jsp</location>
    </error-page>

    Where is the 403.jsp? If you wanted to hit the 403.jsp directly, what URL would you use?
    Karl Baum
    weblog: www.jroller.com/page/kbaum

  6. #6
    Join Date
    Oct 2005
    Posts
    8

    Default

    Hi,

    have tried the /403.jsp too - that didn't work either. what actaully gets displayed is an auto-generated forbidden page..

    if i hit the 403.jsp directly it does get displayed.

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •