This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error page / web.xml  RSS feed

 
Mathias Nilsson
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers!
Here's my problem.
I run a wabapplication under tomcat4 and it works fine, but when I try to
use custom error pages there is a problem.
when I use the xml content below It doesn't work. I've created a directory
under myapp
webapps
|
|-myapp
|
|-errorpages


but when I use this code and put 404.jsp directly under myapp it works fine

Why can't I have a directory to store my errorpages in? have anyone encounted this problem before?
// MAthias
 
Tim Baker
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you're changing the error pages for that web app only so i would suggest you put them in a folder inside that specific web app. ie
web-apps
-your-web-app
--errorpages
the directory you specify in web.xml will be treated as relative to that web-apps folder. so if you really wanted to use your directory structure you would have to do
<error-page>
<error-code>
404
</error-code>
<location>
../errorpages/404.jsp
</location>
</error-page>
however i have no idea if .. will work on there!
if you want all the same error pages accross all web-applications you want to look at the overall server conf and not each web.xml file!
hope i made some sense
 
Mathias Nilsson
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't even begin with ../?? Spec say you must begin with /
I hope I was clear on my structure
webapps/myapp/
under myapp
Images, WEB-INF , errorpages , stylesheets , and so on
Isn't is correct?
 
Tim Baker
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, which leads me to believe you must have a typo somewhere! perhaps the files or directories are not named exactly as you think. check the cApItAlIsAtIoN
 
Mathias Nilsson
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I renamed the directory to e and altered the web.xml and it still doesn't work
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!