Jason,

        Off hand, I don't have any url's for webapp portability, but
Tomcat is the reference model for servlet containers.

Tom K.


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED] On Behalf Of
Jason Johnston
Sent: Monday, July 12, 2004 3:15 PM
To: [EMAIL PROTECTED]
Subject: Application Context URL ?

Ok, if anyone has any insight or the URL's of some good websites on
Webapp portability, I would greatly appreciate it.  I'm running into a
problem where relative URL's are breaking and I can't keep all of them
working.

I have an app deployed at:

http://somewhere.com/app1/

Now my mapping for an application has

/timekeeping/*    going to a specific ctlTime servlet.

This means that both request http://somewhere.com/app1/timekeeping/
and http://somwhere.com/app1/timekeeping will take you to the same
place.  However, depending which one is used the client URL is
different.

When I attempt to reference pictures that are in the app base, graphics
directory  I'm also running into a snafu.

If I set the URL as '../graphics/g1.jpg' then it works most of the
time.  But I can't always guarantee how many directories levels will
exist on the client URL since I'm doing all kinds of server-side
forwarding.  I would like to be able to use the '/graphics/g1.jpg' but
that only works when the app is redeployed at ROOT.

So I've decided that I'll just start setting my <BASE > in the jsp and
set the value in my control servlet so that when the page is called it
can use a <BASE href="<%=base.toString()%>" > .  Now I'm running into
all kinds of issues.

Essentially, in my mind, tomcat should know that my host name is X and
that my web-app context is Y and that a valid URL to my base context is
http://X/Y/  However, no manipulation of the ServletContext or
ServletContextConfig is getting me this information.

The request object has the URL used to get to the servlet, but that's
rather cloogey to me.  Plus there's the chance that's simply wrong and
has gotten to my servlet via mappings.  Setting a document base based on
that is not very reliable.  So if anyone has solved this problem or got
information on keeping a web-app portable with relative URL's, let me
know.

Thanks.

________________________________________________________________________
___
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.682 / Virus Database: 444 - Release Date: 5/11/2004


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.682 / Virus Database: 444 - Release Date: 5/11/2004

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to