tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Lucia" <timlu...@yahoo.com>
Subject RE: Handling 404 thru web.xml
Date Wed, 10 May 2006 16:12:17 GMT
A redirect would change the status code returned to the user agent.  It does
not go through the filters because it is forwarded, and as such is part of
the same request, not a new request.


Tim

-----Original Message-----
From: MC Moisei [mailto:mcmoisei@hotmail.com] 
Sent: Wednesday, May 10, 2006 11:59 AM
To: users@tomcat.apache.org
Subject: Handling 404 thru web.xml

Hi,

Do you know of any issue involving error handling in tomcat (5.5.9) ?

Here's the deal. I defined in my web.xml the following entry

<error-page>
     <error-code>404</error-code>
    <location>/portal.do</location>
</error-page>

When I call, say portal1.do, a page that doesn't exists I get a forward to
the portal.do the thing with the forward is seems that it doesn't go thru
the application filters again. And why this is not a redirect ? The browser
address stays portal1.do instead of portal.do...

Here how the stack trace looks when the portal1.do is called ( this is
normal, check the second trace)


Thread [http-8585-Processor24] (Suspended)
	CustomServlet.service(ServletRequest, ServletResponse) line: 104
	ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) 
line: 252
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse)
line: 173
	FilterSecurityInterceptor.invoke(FilterInvocation) line: 84
	SecurityEnforcementFilter.doFilter(ServletRequest, ServletResponse, 
FilterChain) line: 182
	FilterToBeanProxy.doFilter(ServletRequest, ServletResponse,
FilterChain) 
line: 125
	ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) 
line: 202
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse)
line: 173
	
CustomAuthenticationProcessingFilter(AbstractProcessingFilter).doFilter(Serv
letRequest, 
ServletResponse, FilterChain) line: 305
	FilterToBeanProxy.doFilter(ServletRequest, ServletResponse,
FilterChain) 
line: 125
	ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) 
line: 202
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse)
line: 173
	HttpSessionContextIntegrationFilter.doFilter(ServletRequest, 
ServletResponse, FilterChain) line: 225
	FilterToBeanProxy.doFilter(ServletRequest, ServletResponse,
FilterChain) 
line: 125
	ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) 
line: 202
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse)
line: 173
	ContentReaderFilter.doFilter(ServletRequest, ServletResponse,
FilterChain) 
line: 171
	ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) 
line: 202
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse)
line: 173
	RequestUtilsFilter.doFilter(ServletRequest, ServletResponse,
FilterChain) 
line: 114
	ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) 
line: 202
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse)
line: 173
	StandardWrapperValve.invoke(Request, Response) line: 213
	StandardContextValve.invoke(Request, Response) line: 178
	StandardHostValve.invoke(Request, Response) line: 126
	ErrorReportValve.invoke(Request, Response) line: 105
	StandardEngineValve.invoke(Request, Response) line: 107
	CoyoteAdapter.service(Request, Response) line: 148
	Http11Processor.process(InputStream, OutputStream) line: 856
	
Http11Protocol$Http11ConnectionHandler.processConnection(TcpConnection, 
Object[]) line: 744
	PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line:
527
	LeaderFollowerWorkerThread.runIt(Object[]) line: 80
	ThreadPool$ControlRunnable.run() line: 684
	ThreadWithAttributes(Thread).run() line: 595



Here how the stack trace looks on the forward to /portal.do after 404 was 
intercepted



Thread [http-8585-Processor24] (Suspended (breakpoint at line 74 in 
CustomServlet))
	CustomServlet.service(ServletRequest, ServletResponse) line: 74
	ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) 
line: 252
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse)
line: 173
	ApplicationDispatcher.invoke(ServletRequest, ServletResponse) line:
672
	ApplicationDispatcher.processRequest(ServletRequest,
ServletResponse) line: 
465
	ApplicationDispatcher.doForward(ServletRequest, ServletResponse)
line: 398
	ApplicationDispatcher.forward(ServletRequest, ServletResponse) line:
301
	StandardHostValve.custom(Request, Response, ErrorPage) line: 362
	StandardHostValve.status(Request, Response) line: 283
	StandardHostValve.invoke(Request, Response) line: 136
	ErrorReportValve.invoke(Request, Response) line: 105
	StandardEngineValve.invoke(Request, Response) line: 107
	CoyoteAdapter.service(Request, Response) line: 148
	Http11Processor.process(InputStream, OutputStream) line: 856
	
Http11Protocol$Http11ConnectionHandler.processConnection(TcpConnection, 
Object[]) line: 744
	PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line:
527
	LeaderFollowerWorkerThread.runIt(Object[]) line: 80
	ThreadPool$ControlRunnable.run() line: 684
	ThreadWithAttributes(Thread).run() line: 595


Any idea will be greatly appreciated.

MC

Ps.
On weblogic the error handling triggers a redirect and the above problem is 
not present.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message