Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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
 
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic