tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike W-M" <m...@ward-murphy.co.uk>
Subject Re: JSP to Servlet to JSP pathing issue. RelativePathingPlease help.
Date Tue, 17 Dec 2002 16:27:41 GMT
I was in the same sort of situation a couple of months back.  (I've seen a
few other posts about how relative paths "are difficult" and I'm happy with
my solution so I've not investigated further.)
I've been reminded by your web.xml that one of the things that stopped me
from doing what I wanted was the wildcard-asterisk.  I don't believe it
works as a portion of a name (and I don't think you need it if you've only
got it there to match the parameters, which might be part of your problem) -
only immediately after a "/" to match everything, I seem to recall.  Never
mind!  [Must get on with the work....]

Mike




----- Original Message -----
From: "Jason Johnston" <Jason.Johnston@epa.state.il.us>
To: <tomcat-user@jakarta.apache.org>
Sent: Tuesday, December 17, 2002 4:01 PM
Subject: Re: JSP to Servlet to JSP pathing issue. RelativePathingPlease
help.


Thanks Mike, that's probably the solution I'm going to go with.  I agree
that I don't want absolute URL's.  Though I feel like there should be a
way to do what I'm wanting to do, I'm just not finding it.  I had seen
another suggestion on the forums about mapping the servlet to the same
path as the JSP, which sounded like it might work.  However, I'm running
into problems with that too.

I haven't done much mapping so this is a good exercise for me, but I
will probably just end with the solution you have suggested.

I have the following in my web.xml file

    <servlet>
        <servlet-name>dolookup</servlet-name>
        <servlet-class>test.dolookup</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>dolookup</servlet-name>
    <url-pattern>/teststuff/dolookup*</url-pattern>
    </servlet-mapping>

In my mind, this should make both the lookup.jsp and the dolookup
servlet available from the same path, specifically

http://localhost:8080/teststuff/

If that works, then I can use a simple relative path from the form to
the servlet and the client path won't be changed.  However, I'm not
finding this in practice.  A call to
http://localhost:8080/teststuff/dolookup?etc....   is returning a not
found error.  I'm currently looking up all I can on the forums and
tutorials on mapping, but every time I think I've figured it out - it
doesn't work.  But this is the fun part, I guess.

Thanks for all you help.






--
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