You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mike W-M <mi...@ward-murphy.co.uk> on 2002/12/17 17:27:41 UTC

Re: JSP to Servlet to JSP pathing issue. RelativePathingPlease help.

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" <Ja...@epa.state.il.us>
To: <to...@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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>