Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Tomcat and the fly likes Tomcat cant recognize Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat cant recognize "error-page" tag in web.xml" Watch "Tomcat cant recognize "error-page" tag in web.xml" New topic
Author

Tomcat cant recognize "error-page" tag in web.xml

Ved Antani
Greenhorn

Joined: Jan 05, 2003
Posts: 28
Hi,

I am using Tomcat 5. I am trying to redirect the flow of my application in case of an 404 or 500 error. My web.xml looks like :
<error-page>
<error-code>404</error-code>
<location>/pages/errorpage.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/pages/errorpage.jsp</location>
</error-page>

The page (errorpage.jsp) is in the directory <web-app>/pages/errorpage.jsp

I get the default message from tomcat on 404 error rather than my specified page.

Please guide me

Ved Antani
Greenhorn

Joined: Jan 05, 2003
Posts: 28
I get the following exception instead..
---------------------------------------
NotifyUtil::java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:426)
at java.net.Socket.connect(Socket.java:376)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:386)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:602)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:303)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:264)
at sun.net.www.http.HttpClient.New(HttpClient.java:336)
at sun.net.www.http.HttpClient.New(HttpClient.java:317)
at sun.net.www.http.HttpClient.New(HttpClient.java:312)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:481)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:472)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLCo
nnection.java:528)
at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(N
otifyUtil.java:237)



I cant understand at all...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat cant recognize "error-page" tag in web.xml
 
Similar Threads
Custom Error Page for Error Code 500 in Tomcat
Displaying a Default Error page
Problem configuring Error Page
Having problem with error-page
process errors of user defined URL