File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes style sheet problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "style sheet problems" Watch "style sheet problems" New topic

style sheet problems


Joined: Aug 05, 2003
Posts: 3
hello sir/madam,
i am downloading the html file into word format. while i download i set the my CSS file like this:

<link rel="STYLESHEET" type="text/css" href="<%=sContextPath%>/html/css/professional.css">

where <%=sContextPath%> is the my server relative URLpath. but when i download it asking me to place that
professional.css file in C:\ directory.

while client access my server it is asking client to place the professional.css file in his system.

how to fix this problem?

thanks lot
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

"subra subra",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
To solve this problem, you may need to add the mime-type to the list for the web server or application server (depending on your setup) ie "text/css extension css"
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521

Welcome to JavaRanch!! I appreciate that you changed your display name when David asked , but apparently you didn't READ the policy .
JavaRanch's naming policy. It should not be obviously fictitious.
Your displayed name should be 2 separate names with more than 1 letter each. We really would prefer that you use your REAL name.
You can change your name: here.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Since you don't start your href with a slash, it thinks that what you are desdcribing is relative to your actual URL (like under the /servlet/ directory).
Try adding the leading slash.
I agree. Here's the link:
subject: style sheet problems
It's not a secret anymore!