• 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
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Using Resin 2.0.2 and error-page in web-xml. How?

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The html file is located under above the WEB-INF dir. I try this out by forcing a servlet that throws a MessagingException to rethrow an EmailException(derived from ServletException) but I get a 404 that says it can't locate the email_exception.html??? Something wrong with paths???
edited tags to show the XML
[ July 19, 2002: Message edited by: Frank Carver ]
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The location entry is relative to the application root. (e.g. http://www.myserver.net/myapp/email_exception.html )
and should be placed at the top of the web application, with your other html files. Is that where you have put it ?
Have you checked the name of the file is exactly the same, including the case and the '_' ?
 
Stefan Elfvinge
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I've tried every possible location-value- removing "/", removing "http:/" etc. AND crosschecked spellings 100 times. I even tried this approach in web.xml:

...though, without "id=/myapp"
but same errors!
Anyway, I solved it with HttpServletResponse stream to hardcode some html in the catch-block.
Poor solution? Maybe, but it works...
please comment on this and thanks for your reply!
/Steffe
 
Stefan Elfvinge
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oops, this is the entire new approach:
 
Stefan Elfvinge
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry, here it is again without the code-tags:
<web-app id='/foo'>
<error-page exception-type='java.lang.NullPointerException'<br /> location='/nullpointer.jsp'/>
</web-app>
 
Stefan Elfvinge
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll try hardwriting it...

<web-app id='/foo'>
<error-page exception-type='java.lang.NullPointerException'<br /> location='/nullpointer.jsp'/>
</web-app>

 
Stefan Elfvinge
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Last try, and I am SORRY:
<web-app id='/foo'>
<error-page exception-type='sol.caseman.EmailException'>
<location='/email_exception.html'/>
</web-app>
 
Stefan Elfvinge
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WHY???!!!
Is something fooled by the tags I'm trying to post???

[ July 19, 2002: Message edited by: Frank Carver ]
 
Frank Carver
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is that HTML markup is turned "on" for this forum, so the tags are swallowed by UBB (the bulletin board software). The trick is to place a space after each < character, so that UBB doesn't recognize them as markup. I'll edit your last one for you to show how.
 
Stefan Elfvinge
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Frank!
But what do think about the problem to get the container to "find" the html?
 
The only cure for that is hours of television radiation. And this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic