users@glassfish.java.net

Re: Contexts and JSTL imports

From: <Jan.Luehe_at_Sun.COM>
Date: Fri, 29 Jun 2007 14:54:44 -0700

ITVGuy2000 wrote:

>Prior to working with Glassfish/Netbeans I would always deploy to a context
>of the application name. Something like "/application1" or "/myapp". Doing
>some experimentation with the context data entry in the netbeans ide, I
>realized I could have nested contexts. Something along the lines of
>"/goodapps/myapp" or "/business/businessapp1" or "/personal/myapp". I found
>this very useful for organizing my website into different parts, and then
>deploying those parts seperately while maintaining the illusion of a
>hierarchically structured set of pages. Everything worked great. Until...
>
>In a couple of my pages I embed content from another application (context).
>I do this using the JSTL import the content I need. If I have
><c:import url="/ShowXMLDefs.jsp"
>context="/messingaround/MyGlossaryOneFive"/>
>I get the error:
>java.io.FileNotFoundException: /ShowXMLDefs.jsp
>
>

This is expected to work, and is working for me.

You've deployed your webapp at "/messingaround/MyGlossaryOneFive",
and "ShowXMLDefs.jsp" resides at the top-level directory of your webapp,
right?

Is there anything else deployed underneath "/messingaround"?

Jan

>If I move the application to be at the top of the context
>"/MyGlossaryOneFive" (rather than "/messingaround/MyGlossaryOneFive"), then
>everything works fine.
><c:import url="/ShowXMLDefs.jsp" context="/MyGlossaryOneFive"/>
>gives the result I expect.
>
>Netbeans help screens define a context as a '/' followed by any string. I am
>wondering if JSTL applies a different set of rules.
>
>Two questions:
>Is the string below a valid context?
>"/is/this/a/valid/context"
>Should a JSTL import with the context set to such a string work?
>
>