You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Travers Snyman <tr...@im-systems.com> on 2000/12/07 09:11:05 UTC

Tomcat ignores my image and stylesheets Pleas Help.

My Jsp is running fine, but Tomcat seems to ignore the cascade stylesheet
and image files.

The following code snippet illustrates my problem.

<head>
<META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
<LINK REL=STYLESHEET TYPE="text/css"
HREF="o<%=session.getValue("CSSURL")%>">
</head>
<body>

<center><h2>EntityListObjView</h2></center>
<jsp:useBean   class="oracle.jbo.html.databeans.NavigatorBar"  id="tb"
scope="request" >
<%
 tb.setTargetUrl("EntityListObjView.jsp");
tb.setShowNavigationButtons(true);
tb.initialize(application,session,
request,response,out,"BC4J1_BC4J1AppModule.EntityListObjView");
String sImageBase = (String)session.getValue("ImageBase");
%>
<% out.println("Image base = " + sImageBase);
   out.println("CSSURL = " + session.getValue("CSSURL"));%>
<%
 tb.setImageDir(sImageBase);
 tb.addSeparator();
 tb.addButton(tb.NAVIGATE_FINDFORM , "EntityListObjView_Query.jsp");
 tb.addButton(tb.NAVIGATE_BROWSE , "EntityListObjView_Browse.jsp");
 tb.addButton(tb.NAVIGATE_INSERT , "EntityListObjView_Insert.jsp");
 tb.addButton(tb.NAVIGATE_EDIT , "EntityListObjView_Edit.jsp");
 tb.render();
%>
</jsp:useBean>
<br>

</body>
</html>


The println of Image base and CSSURL shows
"/webapp/images" and
"/webapp/css"


If  I change    HREF="o<%=session.getValue("CSSURL")%>">    to
HREF="my_app">
and copying, the .css file to the myapp directory it works. What am I doing
wrong.


I have deployed to the following directories in TOMCAT_HOME

my_app
               /webapp/
                               css
                                images
               /webapp/
                               classes


I added the following context to server.xml

       <Context path="/my_app" docBase="my_app"
                 defaultSessionTimeOut="30" isWARExpanded="true"
                 isWARValidated="false" isInvokerEnabled="true"
                 isWorkDirPersistent="false" >
        </Context>

Travers Snyman


RE: Tomcat ignores my image and stylesheets Pleas Help.

Posted by "G.Nagarajan" <gn...@dkf.de>.
Hi,
you have to refer to your css file by the full path.
i.e. if your jsp file is  c:\tomcat\webapps\test\dir1\test.jsp and
your css file is in c:\tomcat\webapps\test\dir1\test.css then
the path should be
href="/test/test.css". This is because the jsp file is converted to a
servlet
and the content is sent from the servlet. In the case of a html file you
can just give the file name alone.

regards,
Nagaraj.


-----Original Message-----
From: Travers Snyman [mailto:traverss@im-systems.com]
Sent: Thursday, December 07, 2000 9:11 AM
To: general@jakarta.apache.org
Subject: Tomcat ignores my image and stylesheets Pleas Help.



My Jsp is running fine, but Tomcat seems to ignore the cascade stylesheet
and image files.

The following code snippet illustrates my problem.

<head>
<META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
<LINK REL=STYLESHEET TYPE="text/css"
HREF="o<%=session.getValue("CSSURL")%>">
</head>
<body>

<center><h2>EntityListObjView</h2></center>
<jsp:useBean   class="oracle.jbo.html.databeans.NavigatorBar"  id="tb"
scope="request" >
<%
 tb.setTargetUrl("EntityListObjView.jsp");
tb.setShowNavigationButtons(true);
tb.initialize(application,session,
request,response,out,"BC4J1_BC4J1AppModule.EntityListObjView");
String sImageBase = (String)session.getValue("ImageBase");
%>
<% out.println("Image base = " + sImageBase);
   out.println("CSSURL = " + session.getValue("CSSURL"));%>
<%
 tb.setImageDir(sImageBase);
 tb.addSeparator();
 tb.addButton(tb.NAVIGATE_FINDFORM , "EntityListObjView_Query.jsp");
 tb.addButton(tb.NAVIGATE_BROWSE , "EntityListObjView_Browse.jsp");
 tb.addButton(tb.NAVIGATE_INSERT , "EntityListObjView_Insert.jsp");
 tb.addButton(tb.NAVIGATE_EDIT , "EntityListObjView_Edit.jsp");
 tb.render();
%>
</jsp:useBean>
<br>

</body>
</html>


The println of Image base and CSSURL shows
"/webapp/images" and
"/webapp/css"


If  I change    HREF="o<%=session.getValue("CSSURL")%>">    to
HREF="my_app">
and copying, the .css file to the myapp directory it works. What am I doing
wrong.


I have deployed to the following directories in TOMCAT_HOME

my_app
               /webapp/
                               css
                                images
               /webapp/
                               classes


I added the following context to server.xml

       <Context path="/my_app" docBase="my_app"
                 defaultSessionTimeOut="30" isWARExpanded="true"
                 isWARValidated="false" isInvokerEnabled="true"
                 isWorkDirPersistent="false" >
        </Context>

Travers Snyman


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