tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: <c:url> question
Date Thu, 18 Sep 2003 13:53:04 GMT
Is your browser configured to accept cookies? If not, URL rewriting will be used
for session management. As for actually having a session, by default any JSP
page will create one. If you don't want it to, you need to use the page directive:

<%@ page session="false" %>

Also, by using <c:url> with a relative URL, you're implicitly requesting URL
rewriting. The fact that the <c:out> version still rewrites the URL doesn't make
any sense, it doesn't do that. Try shutting down Tomcat, removing everything in
$CATALINA_HOME/work/Standalone/localhost, and then restarting.

Quoting Michael Duffy <duffymo@yahoo.com>:

> 
> Hi Kris,
> 
> I forced a refresh of the page and still didn't get
> the background image to come down.
> 
> The <c:out> suggestion didn't do it, either.  I still
> see the jsession ID in the URL.
> 
> I'm missing something important here.  I'll have to
> keep digging.  Thanks - MOD
> 
> 
> --- Michael Duffy <duffymo@yahoo.com> wrote:
> > 
> > Hi Kris, 
> > 
> > I don't know - I didn't try hitting the page again. 
> > I'll give it a try and see.
> > 
> > I was surprised to see it, because I don't have any
> > session scope variables in the page.  I don't think
> > I
> > should have a session open.
> > 
> > I'm using Tomcat 4.1.24 as the server.  
> > 
> > I'll try your <c:out> suggestion and see if that
> > helps.  Thanks very much. - MOD
> > 
> > 
> > --- Kris Schneider <kris@dotech.com> wrote:
> > > The next time you hit the page it works though,
> > > right? If you're tracking
> > > sessions via cookies, subsequent responses won't
> > > need to do URL rewriting. It
> > > actually looks like it's a server bug. Hitting
> > > 
> > > http://www.sun.com/im/sun_logo.gif;jsessionid=foo
> > > 
> > > works just fine (SunONE WebServer 6.0), whereas
> > > hitting
> > > 
> > >
> >
> http://www.apache.org/images/asf_logo_wide.gif;jsessionid=foo
> > > 
> > > results in a 404 (Apache/2.0.48-dev (Unix)). Same
> > > here ;-) (Microsoft-IIS/6.0)
> > > 
> > >
> >
> http://www.microsoft.com/homepage/gif/bnr-microsoft.gif;jsessionid=foo
> > > 
> > > You might try something like:
> > > 
> > > <body background="<c:out
> > >
> >
> value="${pageContext.request.contextPath}/images/gray.jpg"/>">
> > > 
> > > Quoting Michael Duffy <duffymo@yahoo.com>:
> > > 
> > > > 
> > > > I'm following the recommendations laid out by
> > > Shawn
> > > > Bayern in "JSTL In Action", but I've run into a
> > > snag.
> > > > 
> > > > On page 136, Shawn recommends using the <c:url>
> > > tag
> > > > for referring to a directory named images in a
> > Web
> > > > application:
> > > > 
> > > > <body background="<c:url
> > > value='/images/gray.jpg'/>">
> > > > <!-- other HTML stuff in here
> > > > </body>
> > > > 
> > > > When I ask Tomcat to send this page, the
> > > background is
> > > > not there.  When I View Source to look at the
> > > HTML, I
> > > > see this:
> > > > 
> > > > <body
> > > >
> > >
> >
>
background="/mock-trading-partner/images/gray.jpg;jsessionid=9B0DA55495E2CD9BF40AAD98A4E115D8">
> > > > 
> > > > Looks to me like that jsessionid is making it so
> > I
> > > > can't find the background.  How do I get rid of
> > > it? 
> > > > Thanks - MOD
> > > 
> > > -- 
> > > Kris Schneider <mailto:kris@dotech.com>
> > > D.O.Tech       <http://www.dotech.com/>

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

Mime
View raw message