You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Rajaiah, Shakila" <sh...@kroger.com> on 2015/11/30 20:07:22 UTC

issues with declaring a path in context.xml

Hello,

I am using Tomcat 8.0.21 with EE7.0 on windows 7.0. For one of my projects it needs to read the style sheets from /style directory which has been placed under /webapps directory.

In my jsp I have added:

<test:includeStyle rel="stylesheet" type="text/css" context="/style" href="/ext-4.0.6/resources/css/ext-all.css" />

Under the tomcat 8.0/webapps directory I added the style folder. tomcat 8.0/webapps/style.

I created a context.xml file with path="/style" and placed it in
C:\tools\apache-tomcat-8.0.21-EE7.0\webapps\style\META-INF directory. The application does not pick up the path for /style.

I tried adding this path attribute to the context.xml file in the conf directory and it did not work either.

Any help as to where this information can be configured in the tomcat server 8.0 will be appreciated.

Thanks,
Shakila.



Shakila Rajaiah, Loyalty Technology Developer
11450 Grooms Road | Cincinnati, Ohio  45242 | Office 513.387.8543 | Mobile 513.967.6084
---------------------------------------------------------------------------------
KROGER TECHNOLOGY
CUSTOMER | QUALITY | INNOVATION



________________________________

This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

Re: issues with declaring a path in context.xml

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Shakila,

On 11/30/15 2:07 PM, Rajaiah, Shakila wrote:
> I am using Tomcat 8.0.21 with EE7.0 on windows 7.0. For one of my
> projects it needs to read the style sheets from /style directory which
> has been placed under /webapps directory.

That's probably not where you want it, but it will certainly work.

> In my jsp I have added:
> 
> <test:includeStyle rel="stylesheet" type="text/css" context="/style" href="/ext-4.0.6/resources/css/ext-all.css" />

You should probably do this instead:

<test:includeStyle rel="stylesheet" type="text/css" context="/style"
href="<c:url value="/ext-4.0.6/resources/css/ext-all.css" />" />

I'm not sure if you'll need the "context" parameter there, or what
<test:includeStyle> will or will not do for you with the "href"
parameter. It's common to have your stylesheets bundled with your
application, but it's not uncommon to have them external to the
application, either.

> Under the tomcat 8.0/webapps directory I added the style folder.
> tomcat 8.0/webapps/style.
> 
> I created a context.xml file with path="/style" and placed it in
> C:\tools\apache-tomcat-8.0.21-EE7.0\webapps\style\META-INF directory.

Okay so you are intending to have a separate context for the "style"
"application". At least you understand what's going on, here.

> The application does not pick up the path for /style.

What do you mean by that?

> I tried adding this path attribute to the context.xml file in the
> conf directory and it did not work either.

The "path" attribute will be ignored at best, and double-deployed at worst.

> Any help as to where this information can be configured in the
> tomcat server 8.0 will be appreciated.

When the JSP runs, what output does it actually produce? What does the
layout of your webapps/styles application look like?

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org