tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milt Epstein <mepst...@uiuc.edu>
Subject Re: Can a URI pattern be matched to a JSP?
Date Wed, 26 Jun 2002 14:38:36 GMT
On Wed, 26 Jun 2002, Prashanth Pushpagiri wrote:

> Hi:

> I tried this but when I add the servlet and servlet-mapping tags to
> the web.xml, Tomcat throws an error during startup!
>
> ERROR reading java.io.ByteArrayInputStream@76cad3
> At Line 57 /web-app/servlet/

This doesn't mean it's not working, you need to figure out what's
causing this error, maybe it's something totally unrelated.  And is
that the entire error message?  It looks incomplete.


> I tried adding the mappings to web.xml files in /conf and my web
> application...neither a success..
>
> Am I doing something wrong? All I want to do is send the request to
> my index.jsp page which will check for something and then serve the
> file out!

At this point, I'm not sure I'm going to be able to help you anymore,
sounds like you've got a different problem.  And you're going to need
to provide more information in order for people to have an idea what's
going on.


> --- Milt Epstein <mepstein@uiuc.edu> wrote:
> > On Tue, 25 Jun 2002, Prashanth Pushpagiri wrote:
> >
> > > Hello everyone:
> > > I am using Tomcat 4.0.4 on IIS. I would like to
> > know if there is a
> > > way of forwarding requests of a particular pattern
> > to a JSP i
> > > specify using Tomcat?
> > >
> > > For eg. say the user requests for a file like
> > > /examples/dln/sample.doc I want tomcat to forward
> > the request to a
> > > JSP /examples/index.jsp instead of serving the
> > file out. I guess
> > > this is similar to what servlet mapping is! A
> > particular URI pattern
> > > '/examples/dln' should be forwarded to a
> > particular JSP
> > > '/examples/index.jsp'.
> > >
> > > Any advice and assistance on this would be very
> > helpful.
> >
> > Yes, you can do this.
> >
> > Just define a servlet in your web.xml, and instead
> > of specifying a
> > servlet-class, specify a jsp-file.  Then you can
> > specify
> > servlet-mapping's back to that servlet.  A la:
> >
> > <servlet>
> >   <servlet-name>somename</servlet-name>
> >   <jsp-file>index.jsp</jsp-file>
> > ...
> > </servlet>
> >
> > <servlet-mapping>
> >   <servlet-name>somename</servlet-name>
> >   <url-pattern>/dln</url-pattern>
> > </servlet-mapping>
> >
> > (You used to be able to specify the jsp-file right
> > in the
> > servlet-mapping  -- i.e. instead of the servlet-name
> > -- but it looks
> > like that was changed in the 2.3 spec.  I think the
> > above gives the
> > same effect, just with the extra expense of having
> > to come up with a
> > servlet name :-).

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