-
1. Re: jboss-web.xml in an .ear
ggregd Jul 25, 2003 11:39 AM (in response to ggregd)I figured it out. You've been very helpful.
OK, fine, I'll spill for the next person. My .ear's application.xml file had the following content:
<web-uri>myApp.war</web-uri>
<context-root>/myApp</context-root>
Which was overriding jboss-web.xml, so I removed the <context-root> element and viola.
Except that wherever I had a servlet URI in my JSP (an image from disk file loader and chart generators) I had to change the page code from
to
Which unless I'm missing something seems like a ding against portability to me - if anyone wants to use the context they need a different set of JSP's.
Greg -
2. Re: jboss-web.xml in an .ear
mtb2ride Aug 6, 2003 4:20 PM (in response to ggregd)Greg,
There are ways to keep from having to change the SRC paths in you Jsps when your web context-root changes.
The best way is to set the html elment
Struts has a tag (<html:base/>) that sets the for you according to where your jsp file is. In your case using <html:base/> would have given you portability.
Steve -
3. Re: jboss-web.xml in an .ear
twutort Aug 22, 2003 8:46 AM (in response to ggregd)Hello,
I have a question that is similar to this. I'm doing a very large port from another server. In order to avoid changing thousands of JSPs I'd like for my include files to pick up from the same directory. However, when I set the following I still have to add wwwroot to my include path:
<context-root>/wwwroot</context-root>
I have to make my include lines in the jsp as follows:
<%@ include file="/wwwroot/includes_jsp/ADMIN/sniffer.shtml" %>
Is there any setting I can make so my include line looks like this:
<%@ include file="/includes_jsp/ADMIN/sniffer.shtml" %>
Thanks,
Tim -
4. Re: jboss-web.xml in an .ear
mtb2ride Aug 26, 2003 2:16 PM (in response to ggregd)Tim,
If your JSPs are laid out in a more flat structure i.e. most of the JSPs are in the same directory, it'd be easy to just use a relative path on your include directive.
example:
If the relative path to the sniffer.shtml is ../../includes_jsp/ADMIN/sniffer.jsp then use
<%@ include file="../../includes_jsp/ADMIN/sniffer.shtml" %>
But, if you have a deep jsp structure, this would probably be tough to do without automating it. With thousands of Jsps, I'd write a search and replace in perl that could compute what your relative directoy pattern is and then apply it to each include directive.
Thanks
Steve