tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milt Epstein <mepst...@uiuc.edu>
Subject Re: path info for servlets and JSPs
Date Fri, 21 Jun 2002 15:04:41 GMT
On Fri, 21 Jun 2002, cbarnes wrote:

> In web.xml I have added a servlet mapping so that the servlet can take extra
> path information as follows:
>
> <servlet-mapping>
>         <servlet-name>myservlet</servlet-name>
>         <url-pattern>/myservlet/*</url-pattern>
> </servlet-mapping>
>
> Is it possible to do something similar with JSPs - and if so how and
> where do I configure this?
> I would like to be able to use a URL such as
> http://server/application/mypage.jsp/extra/path/info

I don't think this is possible directly, with the way extensions are
handled (I think the extension has to be in the last segement of the
URL path).  You should check out the spec on this point, it's not too
hard to deciper.

As someone else suggested, you might be able to use the query string
to do this.

In addition, you might be able to use a servlet-mapping to do this.
The key point to note is that you can use a servlet-mapping to link a
url-pattern to a jsp-file instead of a servlet-name.  So if you have a
servlet-mapping like:

  <servlet-mapping>
    <jsp-file>mypage.jsp</jsp-file>
    <url-pattern>mypagejsp</url-pattern>
  </servlet-mapping>

You could use a URL like:

http://server/application/mypagejsp/extra/path/info

(Warning: The above is totally untested and will likely need to be
hashed out to get working.)

Milt Epstein
Research Programmer
Systems and Technology Services (STS)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message