tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Kevin" <Kevin_C...@bmc.com>
Subject question about RequestDispatcher.forward() in tomcat
Date Wed, 08 Nov 2000 23:31:56 GMT
I am trying to implement a MVC system. the controller
will intercept all request for .jsp page, then forward
it to the jsp page after some checking.

I am using TOMCAT to run the servlet. and using
extension rul mapping, i.e.:(in web.xml)
    <servlet-mapping>
    <servlet-name> controller </servlet-name>
    <url-pattern> *.jsp </url-pattern>
    </servlet-mapping>
My test controller just forward the page to another jsp page,
the code looks like:
    RequestDispatcher dis;
    dis=getServletContext().getRequestDispatcher("/index.jsp");
    dis.forward (req, res);
    //dis.include (req, res);

the problem with above approach is that, my controller will
intercept the index.jsp too. which will cause the page cannot
be displayed. looks like the servlet container resend the
index.jsp page to me again and again.


Is there anyway around it?

Appreciate any help.
kevin

Mime
View raw message