tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lacerda, Wellington (AFIS)" <>
Subject RE: question about RequestDispatcher.forward() in tomcat
Date Mon, 13 Nov 2000 10:33:10 GMT
I wrote a small MVC framework and I have my controller mapped to a common
name like "dispatch.htm" and I send all requests directly to it, with a
parameter specifying the action. So, all the requests are always like:

<a href="dispatch.htm?ACTION=XXX&PARM1=YYY&...">do something</a>

It's working fairly well.

Wellington Silva

-----Original Message-----
From: Chen, Kevin []
Sent: 09 November 2000 00:32
To: ''
Subject: question about RequestDispatcher.forward() in tomcat

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-name> controller </servlet-name>
    <url-pattern> *.jsp </url-pattern>
My test controller just forward the page to another jsp page,
the code looks like:
    RequestDispatcher dis;
    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.

View raw message