Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Using <error-page> in web.xml

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a simple Spring security example using MySQL as the credential store. The application is working correctly in terms of authentication and authorization. I am running on the VmWare vFabric tc server inside Eclipse. When a user tries to access a page for which he does not have authorization I would like to direct him to a custom jsp, authfail.jsp. I tried to do this via the <error-page> tag in my web.xml file. When I try to access a page without proper authorization I get what appears to be a default error page titled "HTTP 403 Forbidden". This page has an i in a circle with the message: "The website declined to show this webpage", with some options that follow. I do not get my custom authfail.jsp page. However, if I run up the VmWare vFabric server from inside Eclipse, then access the URL from a web browser, I do get my custom page. Is there a way to get this page when accessing URLs from inside Eclipse? Thanks in advance

My web.xml is

 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post your spring xml. The 403 error might be returned from Spring
 
Mike Tabak
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jayesh A Lalwani wrote:Can you post your spring xml. The 403 error might be returned from Spring



I'm sure the error is being returned by Spring, I am trying to access a page I don't have authorization for. I'm just trying to show a custom jsp page in that case. Here is my spring security config:



Here is my servlet context:



I won't post datasource-tx.xml as this contains only database configs and I have verified by turning on debug that I am accessing the database without issues. Also there is nothing in my
root-context.xml
reply
    Bookmark Topic Watch Topic
  • New Topic