You are misunderstanding when the CSS gets used.  CSS is client-side. When the browser parses the html you send, it will see the <LINK> tag and download the external css document to apply styles.
 
A simple way to deal with this is have your CSS off the document root or in a sub-dir just off the doc-root:
 
<LINK
            REL="stylesheet"
            TYPE="text/css"
            HREF="/css/mycss.css" >
 
so, the file could be dowloaded if someone typed in this URL:
 
 
HTH
 
----- Original Message -----
Sent: Wednesday, June 20, 2001 3:28 PM
Subject: Aaarrrghhh!! CSS and Servlet again

Hi all again,
I have been trying all lot of different ways to pick uppthe CSS file but without any success. So I'll try to see if anyone has some more thing to add to my problem.

The question is still there, where should I put my CSS file and how should I pick it up from the servlet.

Som information:
server.xml:
<application name="Lab01" path="C:\oracle\JDeveloper 3.2.3\myprojects\lab_01" />

default-web-site.xml:
<!-- LAB 01 -->
<web-app application="Lab01" name="web" root="/lab01" />

web.xml:
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<display-name>Lab 01</display-name>
<description>desc</description>
<servlet>
<servlet-name>EmployeeServlet</servlet-name>
<servlet-class>training.EmployeeServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>training.EmployeeServlet</servlet-name>
<url-pattern>/</url-pattern> -->
</servlet-mapping>
</web-app>

application.xml:
<?xml version="1.0"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" "http://java.sun.com/j2ee/dtds/application_1_2.dtd">

<display-name>Lab01</display-name>
<module>
<web>
<web-uri>web</web-uri>
<context-root>/</context-root>
</web>
</module>
</application>

Directory structure of the WEB-APP:
_lab_01
|_META-INF
| |_application.xml
|_web
|____|WEB-INF
|____________|web.xml
|____________________|classes
|____________________________|pkg
|________________________________|myServlet

Help



Get your FREE download of MSN Explorer at http://explorer.msn.com

Reply via email to