tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Šiplák <msip...@ew.sk>
Subject Problem with forward in Servlet Filter
Date Fri, 03 Oct 2003 15:23:03 GMT
I use tomcat 4
I try write secure servlet fitler. When I recognize that user is not
authorized I try change web resource whith RequestDispatcher. But response
is only "404 not found"

This is example of my code:

doFilter.....{

		if(userHaveRights())
		{
			String path =
((HttpServletRequest)request).getContextPath()+"/errorpages/errMessage.jsp";
			try{
				RequestDispatcher ds = this.ctx.getRequestDispatcher(cesta);
				ds.forward(request,response);
				return;
			}
			catch(Exception e){
				System.err.println("SOMETHING");
			}
		}
		else
		{
			chain.doFilter(request, response);
		}

}

Thanks for advice.

Michal


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

---
Příchozí zpráva neobsahuje viry.
Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz).
Verze: 6.0.518 / Virová báze: 316 - datum vydání: 11. 9. 2003


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


Mime
View raw message