You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Trenton Adams <tr...@trentonadams.ca> on 2007/11/28 10:51:05 UTC

c:url and context path completion

I was sure that I had read somewhere that "<c:url 
value="/images/pluslittle.gif"/>" usage would automatically cause the 
context path to be entered into the output of "c:url".  Is that not 
correct?  Because it's not working!

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Trenton Adams <tr...@trentonadams.ca>.
Trenton Adams wrote:
> I was sure that I had read somewhere that "<c:url 
> value="/images/pluslittle.gif"/>" usage would automatically cause the 
> context path to be entered into the output of "c:url".  Is that not 
> correct?  Because it's not working!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
I found the problem.  I'm going like this...

<c:set var="IMAGES" value="/images/"/>
<img src="${IMAGES}/pluslittle.gif"/>

Which ends up not working.  So, I was right, it was working at one 
point.  But, when I replaced "c:url" with "c:set", it OBVIOUSLY would 
quit working on me.  But, since I was working on the default context, I 
never saw the problem.  Now, I have changed "set" to "url", and it works 
just fine.

Sorry for wasting everyone's time.  AHHHHHH!!!!  LOL.


I probably would have caught this a few months ago, while I was "into 
it", but I haven't been doing development on that application for awhile 
now, so I think my brain was out.

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Trenton Adams <tr...@trentonadams.ca>.
Kris Schneider wrote:
> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>   
>> Kris Schneider wrote:
>>     
>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>>>
>>>       
>>>> Kris Schneider wrote:
>>>>
>>>>         
>>>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>>>>>
>>>>>
>>>>>           
>>>>>> Kris Schneider wrote:
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>>> I was sure that I had read somewhere that "<c:url
>>>>>>>> value="/images/pluslittle.gif"/>" usage would automatically cause the
>>>>>>>> context path to be entered into the output of "c:url".  Is that not
>>>>>>>> correct?  Because it's not working!
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                 
>>>>>>> From the JSTL 1.1 Spec for <c:url>:
>>>>>>>
>>>>>>> As a consequence, an implementation must prepend the context path to a
>>>>>>> URL that starts with a slash (e.g. "/page2.jsp") so that such URLs can
>>>>>>> be properly interpreted by a client browser.
>>>>>>>
>>>>>>> So, yes, the context should be prepended. What output are you actually seeing?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> I'm seeing it produce "/images/pluslittle.gif", and it completely
>>>>>> ignores the context path.  I'm using tomcat 6 and java 1.5
>>>>>>
>>>>>>
>>>>>>             
>>>>> This wouldn't happen to be a JSP sitting in webapps/ROOT, would it?
>>>>> Just checking...
>>>>>
>>>>>
>>>>>
>>>>>           
>>>> No, it's sitting in "webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"
>>>>
>>>>         
>>> Oh well, worth a shot. I don't have TC 6 installed to test, but maybe
>>> I'll do that later tonight. Does TC 6 come with an implementation of
>>> JSTL 1.2 or are you using JSTL 1.1? Does your app use a Servlet 2.5 or
>>> 2.4 web.xml?
>>>
>>>
>>>       
>> I tried 5.5 just now, and it has the same problem.
>>
>> Tomcat 6 does not come with JSTL.
>>
>> web.xml is using 2.3
>> <!DOCTYPE web-app
>>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>     "http://java.sun.com/dtd/web-app_2_3.dtd">
>>
>>
>> I am using JSTL 1.1.2
>>     
>
> For starters, try this:
>
> <web-app xmlns="http://java.sun.com/xml/ns/javaee"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>          version="2.5">
>     ...
> </web-app>
>
> No DOCTYPE. Unless your app really needs to be 2.3-based...
>
>   
No affect, still have the problem.  I stopped tomcat, restarted, and 
removed the work directory for my context, just in case, but still see 
the problem.

FYI: I'm initializing like so...

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/benchmark-1.0" 
prefix="bm" %>

I think I'll try a simple test case, like Hassan suggested.

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Kris Schneider <kr...@directthought.com>.
On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> Kris Schneider wrote:
> > On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >
> >> Kris Schneider wrote:
> >>
> >>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >>>
> >>>
> >>>> Kris Schneider wrote:
> >>>>
> >>>>
> >>>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>> I was sure that I had read somewhere that "<c:url
> >>>>>> value="/images/pluslittle.gif"/>" usage would automatically cause the
> >>>>>> context path to be entered into the output of "c:url".  Is that not
> >>>>>> correct?  Because it's not working!
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>> From the JSTL 1.1 Spec for <c:url>:
> >>>>>
> >>>>> As a consequence, an implementation must prepend the context path to a
> >>>>> URL that starts with a slash (e.g. "/page2.jsp") so that such URLs can
> >>>>> be properly interpreted by a client browser.
> >>>>>
> >>>>> So, yes, the context should be prepended. What output are you actually seeing?
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>> I'm seeing it produce "/images/pluslittle.gif", and it completely
> >>>> ignores the context path.  I'm using tomcat 6 and java 1.5
> >>>>
> >>>>
> >>> This wouldn't happen to be a JSP sitting in webapps/ROOT, would it?
> >>> Just checking...
> >>>
> >>>
> >>>
> >> No, it's sitting in "webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"
> >>
> >
> > Oh well, worth a shot. I don't have TC 6 installed to test, but maybe
> > I'll do that later tonight. Does TC 6 come with an implementation of
> > JSTL 1.2 or are you using JSTL 1.1? Does your app use a Servlet 2.5 or
> > 2.4 web.xml?
> >
> >
> I tried 5.5 just now, and it has the same problem.
>
> Tomcat 6 does not come with JSTL.
>
> web.xml is using 2.3
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>     "http://java.sun.com/dtd/web-app_2_3.dtd">
>
>
> I am using JSTL 1.1.2

For starters, try this:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">
    ...
</web-app>

No DOCTYPE. Unless your app really needs to be 2.3-based...

-- 
Kris Schneider <ma...@directThought.com>
directThought  <http://www.directThought.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Trenton Adams <tr...@trentonadams.ca>.
Kris Schneider wrote:
> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>   
>> Kris Schneider wrote:
>>     
>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>>>
>>>       
>>>> Kris Schneider wrote:
>>>>
>>>>         
>>>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>>>>>
>>>>>
>>>>>           
>>>>>> I was sure that I had read somewhere that "<c:url
>>>>>> value="/images/pluslittle.gif"/>" usage would automatically cause the
>>>>>> context path to be entered into the output of "c:url".  Is that not
>>>>>> correct?  Because it's not working!
>>>>>>
>>>>>>
>>>>>>             
>>>>> From the JSTL 1.1 Spec for <c:url>:
>>>>>
>>>>> As a consequence, an implementation must prepend the context path to a
>>>>> URL that starts with a slash (e.g. "/page2.jsp") so that such URLs can
>>>>> be properly interpreted by a client browser.
>>>>>
>>>>> So, yes, the context should be prepended. What output are you actually seeing?
>>>>>
>>>>>
>>>>>
>>>>>           
>>>> I'm seeing it produce "/images/pluslittle.gif", and it completely
>>>> ignores the context path.  I'm using tomcat 6 and java 1.5
>>>>
>>>>         
>>> This wouldn't happen to be a JSP sitting in webapps/ROOT, would it?
>>> Just checking...
>>>
>>>
>>>       
>> No, it's sitting in "webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"
>>     
>
> Oh well, worth a shot. I don't have TC 6 installed to test, but maybe
> I'll do that later tonight. Does TC 6 come with an implementation of
> JSTL 1.2 or are you using JSTL 1.1? Does your app use a Servlet 2.5 or
> 2.4 web.xml?
>
>   
I tried 5.5 just now, and it has the same problem.

Tomcat 6 does not come with JSTL.

web.xml is using 2.3
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">


I am using JSTL 1.1.2

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Kris Schneider <kr...@directthought.com>.
On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> Kris Schneider wrote:
> > On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >
> >> Kris Schneider wrote:
> >>
> >>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >>>
> >>>
> >>>> I was sure that I had read somewhere that "<c:url
> >>>> value="/images/pluslittle.gif"/>" usage would automatically cause the
> >>>> context path to be entered into the output of "c:url".  Is that not
> >>>> correct?  Because it's not working!
> >>>>
> >>>>
> >>> From the JSTL 1.1 Spec for <c:url>:
> >>>
> >>> As a consequence, an implementation must prepend the context path to a
> >>> URL that starts with a slash (e.g. "/page2.jsp") so that such URLs can
> >>> be properly interpreted by a client browser.
> >>>
> >>> So, yes, the context should be prepended. What output are you actually seeing?
> >>>
> >>>
> >>>
> >> I'm seeing it produce "/images/pluslittle.gif", and it completely
> >> ignores the context path.  I'm using tomcat 6 and java 1.5
> >>
> >
> > This wouldn't happen to be a JSP sitting in webapps/ROOT, would it?
> > Just checking...
> >
> >
> No, it's sitting in "webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"

Oh well, worth a shot. I don't have TC 6 installed to test, but maybe
I'll do that later tonight. Does TC 6 come with an implementation of
JSTL 1.2 or are you using JSTL 1.1? Does your app use a Servlet 2.5 or
2.4 web.xml?

-- 
Kris Schneider <ma...@directThought.com>
directThought  <http://www.directThought.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


RE: c:url and context path completion

Posted by "DeVries, Joe M" <jd...@tamu.edu>.

Joe DeVries 
Lead Software Application Developer 
Division of Finance - IT Services
Texas A&M University 
Phone: 845-8297 Mail Stop: 1182 
Email: jdevries@tamu.edu
-----Original Message-----
From: mfncooper@gmail.com [mailto:mfncooper@gmail.com] On Behalf Of
Martin Cooper
Sent: Wednesday, November 28, 2007 3:49 PM
To: Tag Libraries Users List
Subject: Re: c:url and context path completion

On Nov 28, 2007 1:43 PM, Trenton Adams <tr...@trentonadams.ca> wrote:

> Martin Cooper wrote:
> > On Nov 28, 2007 1:01 PM, Trenton Adams <tr...@trentonadams.ca>
wrote:
> >
> >
> >> Kris Schneider wrote:
> >>
> >>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >>>
> >>>
> >>>> Kris Schneider wrote:
> >>>>
> >>>>
> >>>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>> I was sure that I had read somewhere that "<c:url
> >>>>>> value="/images/pluslittle.gif"/>" usage would automatically
cause
> the
> >>>>>> context path to be entered into the output of "c:url".  Is that
not
> >>>>>> correct?  Because it's not working!
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>> From the JSTL 1.1 Spec for <c:url>:
> >>>>>
> >>>>> As a consequence, an implementation must prepend the context
path to
> a
> >>>>> URL that starts with a slash (e.g. "/page2.jsp") so that such
URLs
> can
> >>>>> be properly interpreted by a client browser.
> >>>>>
> >>>>> So, yes, the context should be prepended. What output are you
> actually
> >>>>>
> >> seeing?
> >>
> >>>>>
> >>>>>
> >>>> I'm seeing it produce "/images/pluslittle.gif", and it completely
> >>>> ignores the context path.  I'm using tomcat 6 and java 1.5
> >>>>
> >>>>
> >>> This wouldn't happen to be a JSP sitting in webapps/ROOT, would
it?
> >>> Just checking...
> >>>
> >>>
> >>>
> >> No, it's sitting in
"webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"
> >>
> >
> >
> > Well, that's very likely the cause of what you're seeing. Anything
under
> > WEB-INF is not permitted to be accessed directly (i.e. from outside
the
> web
> > app itself), so the context is irrelevant for such files, since it
could
> > never be used to access them.
> >
> >
> I don't think that is the problem, I do it all the time.  My servlet
> accesses the JSP's through dispatching.  The browser has no need to
> access my JSP files directly, which is why I put them in WEB-INF.
> Perhaps putting everything in WEB-INF is causing the problem, but
> definitely not for the reason you described.  But, I will be looking
> into this to see if putting my JSPs in WEB-INF is causing the problem
or
> not.  But, I'm pretty darn sure this worked before.  But, then again,
> maybe it's because I never used anything other than the default
context,
> so I never noticed before?!?!?!


Yeah, sorry, I realised a few seconds after I hit Send that I was being
a
dope. I'm not sure if this demonstrates that taglibs knowledge "leaks"
when
you don't use them for a while, or that I need to break for lunch... ;-)

--
Martin Cooper



> > --
> > Martin Cooper
> >
> >
> >
> >>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
taglibs-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Martin Cooper <ma...@apache.org>.
On Nov 28, 2007 1:43 PM, Trenton Adams <tr...@trentonadams.ca> wrote:

> Martin Cooper wrote:
> > On Nov 28, 2007 1:01 PM, Trenton Adams <tr...@trentonadams.ca> wrote:
> >
> >
> >> Kris Schneider wrote:
> >>
> >>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >>>
> >>>
> >>>> Kris Schneider wrote:
> >>>>
> >>>>
> >>>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>> I was sure that I had read somewhere that "<c:url
> >>>>>> value="/images/pluslittle.gif"/>" usage would automatically cause
> the
> >>>>>> context path to be entered into the output of "c:url".  Is that not
> >>>>>> correct?  Because it's not working!
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>> From the JSTL 1.1 Spec for <c:url>:
> >>>>>
> >>>>> As a consequence, an implementation must prepend the context path to
> a
> >>>>> URL that starts with a slash (e.g. "/page2.jsp") so that such URLs
> can
> >>>>> be properly interpreted by a client browser.
> >>>>>
> >>>>> So, yes, the context should be prepended. What output are you
> actually
> >>>>>
> >> seeing?
> >>
> >>>>>
> >>>>>
> >>>> I'm seeing it produce "/images/pluslittle.gif", and it completely
> >>>> ignores the context path.  I'm using tomcat 6 and java 1.5
> >>>>
> >>>>
> >>> This wouldn't happen to be a JSP sitting in webapps/ROOT, would it?
> >>> Just checking...
> >>>
> >>>
> >>>
> >> No, it's sitting in "webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"
> >>
> >
> >
> > Well, that's very likely the cause of what you're seeing. Anything under
> > WEB-INF is not permitted to be accessed directly (i.e. from outside the
> web
> > app itself), so the context is irrelevant for such files, since it could
> > never be used to access them.
> >
> >
> I don't think that is the problem, I do it all the time.  My servlet
> accesses the JSP's through dispatching.  The browser has no need to
> access my JSP files directly, which is why I put them in WEB-INF.
> Perhaps putting everything in WEB-INF is causing the problem, but
> definitely not for the reason you described.  But, I will be looking
> into this to see if putting my JSPs in WEB-INF is causing the problem or
> not.  But, I'm pretty darn sure this worked before.  But, then again,
> maybe it's because I never used anything other than the default context,
> so I never noticed before?!?!?!


Yeah, sorry, I realised a few seconds after I hit Send that I was being a
dope. I'm not sure if this demonstrates that taglibs knowledge "leaks" when
you don't use them for a while, or that I need to break for lunch... ;-)

--
Martin Cooper



> > --
> > Martin Cooper
> >
> >
> >
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>

Re: c:url and context path completion

Posted by Trenton Adams <tr...@trentonadams.ca>.
Martin Cooper wrote:
> On Nov 28, 2007 1:01 PM, Trenton Adams <tr...@trentonadams.ca> wrote:
>
>   
>> Kris Schneider wrote:
>>     
>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>>>
>>>       
>>>> Kris Schneider wrote:
>>>>
>>>>         
>>>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>>>>>
>>>>>
>>>>>           
>>>>>> I was sure that I had read somewhere that "<c:url
>>>>>> value="/images/pluslittle.gif"/>" usage would automatically cause the
>>>>>> context path to be entered into the output of "c:url".  Is that not
>>>>>> correct?  Because it's not working!
>>>>>>
>>>>>>
>>>>>>             
>>>>> From the JSTL 1.1 Spec for <c:url>:
>>>>>
>>>>> As a consequence, an implementation must prepend the context path to a
>>>>> URL that starts with a slash (e.g. "/page2.jsp") so that such URLs can
>>>>> be properly interpreted by a client browser.
>>>>>
>>>>> So, yes, the context should be prepended. What output are you actually
>>>>>           
>> seeing?
>>     
>>>>>
>>>>>           
>>>> I'm seeing it produce "/images/pluslittle.gif", and it completely
>>>> ignores the context path.  I'm using tomcat 6 and java 1.5
>>>>
>>>>         
>>> This wouldn't happen to be a JSP sitting in webapps/ROOT, would it?
>>> Just checking...
>>>
>>>
>>>       
>> No, it's sitting in "webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"
>>     
>
>
> Well, that's very likely the cause of what you're seeing. Anything under
> WEB-INF is not permitted to be accessed directly (i.e. from outside the web
> app itself), so the context is irrelevant for such files, since it could
> never be used to access them.
>
>   
I don't think that is the problem, I do it all the time.  My servlet 
accesses the JSP's through dispatching.  The browser has no need to 
access my JSP files directly, which is why I put them in WEB-INF.  
Perhaps putting everything in WEB-INF is causing the problem, but 
definitely not for the reason you described.  But, I will be looking 
into this to see if putting my JSPs in WEB-INF is causing the problem or 
not.  But, I'm pretty darn sure this worked before.  But, then again, 
maybe it's because I never used anything other than the default context, 
so I never noticed before?!?!?!
> --
> Martin Cooper
>
>
>   
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>>
>>
>>     
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Trenton Adams <tr...@trentonadams.ca>.
Hassan Schroeder wrote:
> On Nov 28, 2007 1:38 PM, Martin Cooper <ma...@apache.org> wrote:
>
>   
>>> No, it's sitting in "webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"
>>>       
>
>   
>> Well, that's very likely the cause of what you're seeing. Anything under
>> WEB-INF is not permitted to be accessed directly (i.e. from outside the web
>> app itself), so the context is irrelevant for such files, since it could
>> never be used to access them.
>>     
>
> Sorry, that's just not remotely true. Most of my apps are done that
> way, and JSTL, including <c:url .../>, works fine.
>
>   
Yeah, I was pretty sure it was working at one point.  I'm starting to 
wonder if it's the Mac, or maybe Apple's Java implementation.  I should 
go and try it on my Linux box again.  And, if it works, maybe I can try 
a fink installation of Java on my Mac. 
But first, I'm going to try a minimalized JSP webapp like you suggested 
before, because that's relatively quick, and I'm almost done.

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Hassan Schroeder <ha...@gmail.com>.
On Nov 28, 2007 1:38 PM, Martin Cooper <ma...@apache.org> wrote:

> > No, it's sitting in "webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"

> Well, that's very likely the cause of what you're seeing. Anything under
> WEB-INF is not permitted to be accessed directly (i.e. from outside the web
> app itself), so the context is irrelevant for such files, since it could
> never be used to access them.

Sorry, that's just not remotely true. Most of my apps are done that
way, and JSTL, including <c:url .../>, works fine.

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Martin Cooper <ma...@apache.org>.
On Nov 28, 2007 1:01 PM, Trenton Adams <tr...@trentonadams.ca> wrote:

> Kris Schneider wrote:
> > On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >
> >> Kris Schneider wrote:
> >>
> >>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >>>
> >>>
> >>>> I was sure that I had read somewhere that "<c:url
> >>>> value="/images/pluslittle.gif"/>" usage would automatically cause the
> >>>> context path to be entered into the output of "c:url".  Is that not
> >>>> correct?  Because it's not working!
> >>>>
> >>>>
> >>> From the JSTL 1.1 Spec for <c:url>:
> >>>
> >>> As a consequence, an implementation must prepend the context path to a
> >>> URL that starts with a slash (e.g. "/page2.jsp") so that such URLs can
> >>> be properly interpreted by a client browser.
> >>>
> >>> So, yes, the context should be prepended. What output are you actually
> seeing?
> >>>
> >>>
> >>>
> >> I'm seeing it produce "/images/pluslittle.gif", and it completely
> >> ignores the context path.  I'm using tomcat 6 and java 1.5
> >>
> >
> > This wouldn't happen to be a JSP sitting in webapps/ROOT, would it?
> > Just checking...
> >
> >
> No, it's sitting in "webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"


Well, that's very likely the cause of what you're seeing. Anything under
WEB-INF is not permitted to be accessed directly (i.e. from outside the web
app itself), so the context is irrelevant for such files, since it could
never be used to access them.

--
Martin Cooper


>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>

Re: c:url and context path completion

Posted by Trenton Adams <tr...@trentonadams.ca>.
Hassan Schroeder wrote:
> On Nov 28, 2007 1:01 PM, Trenton Adams <tr...@trentonadams.ca> wrote:
>
>   
>>>> I'm seeing it produce "/images/pluslittle.gif", and it completely
>>>> ignores the context path.  I'm using tomcat 6 and java 1.5
>>>>         
>
> I've never seen this *not* work. Do any of your JSTL tags work? What
> is the Servlet Spec version in your web.xml?
>
> Can you create a test case WAR to demonstrate the problem?
>
>   
Okay, it's really annoying, but when I put an index.jsp in the root of a 
webapp, and use c:url, it works just fine.  I guess I'll create a small 
dispatcher servlet now, and see if that works, then if that works, move 
index.jsp into "WEB-INF/jsp" or something.

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Trenton Adams <tr...@trentonadams.ca>.
Hassan Schroeder wrote:
> On Nov 28, 2007 1:01 PM, Trenton Adams <tr...@trentonadams.ca> wrote:
>
>   
>>>> I'm seeing it produce "/images/pluslittle.gif", and it completely
>>>> ignores the context path.  I'm using tomcat 6 and java 1.5
>>>>         
>
> I've never seen this *not* work. Do any of your JSTL tags work? What
> is the Servlet Spec version in your web.xml?
>
> Can you create a test case WAR to demonstrate the problem?
>
>   
Yes, I'm with you, I haven't seen it not work before either.  I am on 
Mac OS X Leopard, if that makes any difference.  It shouldn't though.  
But yes, the JSTL tags appear to work just fine.  I use them everywhere.

If no other ideas arise, I'll see if I can create a simpler test case.

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Hassan Schroeder <ha...@gmail.com>.
On Nov 28, 2007 1:01 PM, Trenton Adams <tr...@trentonadams.ca> wrote:

> >> I'm seeing it produce "/images/pluslittle.gif", and it completely
> >> ignores the context path.  I'm using tomcat 6 and java 1.5

I've never seen this *not* work. Do any of your JSTL tags work? What
is the Servlet Spec version in your web.xml?

Can you create a test case WAR to demonstrate the problem?

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Trenton Adams <tr...@trentonadams.ca>.
Kris Schneider wrote:
> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>   
>> Kris Schneider wrote:
>>     
>>> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>>>
>>>       
>>>> I was sure that I had read somewhere that "<c:url
>>>> value="/images/pluslittle.gif"/>" usage would automatically cause the
>>>> context path to be entered into the output of "c:url".  Is that not
>>>> correct?  Because it's not working!
>>>>
>>>>         
>>> From the JSTL 1.1 Spec for <c:url>:
>>>
>>> As a consequence, an implementation must prepend the context path to a
>>> URL that starts with a slash (e.g. "/page2.jsp") so that such URLs can
>>> be properly interpreted by a client browser.
>>>
>>> So, yes, the context should be prepended. What output are you actually seeing?
>>>
>>>
>>>       
>> I'm seeing it produce "/images/pluslittle.gif", and it completely
>> ignores the context path.  I'm using tomcat 6 and java 1.5
>>     
>
> This wouldn't happen to be a JSP sitting in webapps/ROOT, would it?
> Just checking...
>
>   
No, it's sitting in "webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp"

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Kris Schneider <kr...@directthought.com>.
On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> Kris Schneider wrote:
> > On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> >
> >> I was sure that I had read somewhere that "<c:url
> >> value="/images/pluslittle.gif"/>" usage would automatically cause the
> >> context path to be entered into the output of "c:url".  Is that not
> >> correct?  Because it's not working!
> >>
> >
> > From the JSTL 1.1 Spec for <c:url>:
> >
> > As a consequence, an implementation must prepend the context path to a
> > URL that starts with a slash (e.g. "/page2.jsp") so that such URLs can
> > be properly interpreted by a client browser.
> >
> > So, yes, the context should be prepended. What output are you actually seeing?
> >
> >
> I'm seeing it produce "/images/pluslittle.gif", and it completely
> ignores the context path.  I'm using tomcat 6 and java 1.5

This wouldn't happen to be a JSP sitting in webapps/ROOT, would it?
Just checking...

-- 
Kris Schneider <ma...@directThought.com>
directThought  <http://www.directThought.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:url and context path completion

Posted by Trenton Adams <tr...@trentonadams.ca>.
Kris Schneider wrote:
> On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
>   
>> I was sure that I had read somewhere that "<c:url
>> value="/images/pluslittle.gif"/>" usage would automatically cause the
>> context path to be entered into the output of "c:url".  Is that not
>> correct?  Because it's not working!
>>     
>
> From the JSTL 1.1 Spec for <c:url>:
>
> As a consequence, an implementation must prepend the context path to a
> URL that starts with a slash (e.g. "/page2.jsp") so that such URLs can
> be properly interpreted by a client browser.
>
> So, yes, the context should be prepended. What output are you actually seeing?
>
>   
I'm seeing it produce "/images/pluslittle.gif", and it completely 
ignores the context path.  I'm using tomcat 6 and java 1.5

Re: c:url and context path completion

Posted by Kris Schneider <kr...@directthought.com>.
On 11/28/07, Trenton Adams <tr...@trentonadams.ca> wrote:
> I was sure that I had read somewhere that "<c:url
> value="/images/pluslittle.gif"/>" usage would automatically cause the
> context path to be entered into the output of "c:url".  Is that not
> correct?  Because it's not working!

>From the JSTL 1.1 Spec for <c:url>:

As a consequence, an implementation must prepend the context path to a
URL that starts with a slash (e.g. "/page2.jsp") so that such URLs can
be properly interpreted by a client browser.

So, yes, the context should be prepended. What output are you actually seeing?

-- 
Kris Schneider <ma...@directThought.com>
directThought  <http://www.directThought.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org