File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes WSAD error accessing css in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "WSAD error accessing css in jsp" Watch "WSAD error accessing css in jsp" New topic

WSAD error accessing css in jsp

Jason Kretzer
Ranch Hand

Joined: May 31, 2001
Posts: 280
Hello all,
Getting a strange error message in WSAD. I am testing my app on the default WSAD server.
I start the server and goto the built-in web browser and access the login.html.
This posts to a servlet which then verifies and forwards to the next window which is a
jsp. When it gets to the jsp, the css it is supposed to use does not get used. I
get this error in the console window

In relation to the jsp the css file is ../css/nyk-style-00.css. In the jsp I am using the following to load it.

I have also tried it the following way without the quotes.

I have also tried it straight without an intermediate string.

Anyone have any ideas? It works when I use the full path to the css instead of the relative path.
[ February 10, 2004: Message edited by: Jason Kretzer ]

Jason R. Kretzer<br />Software Engineer<br />System Administrator<br /><a href="" target="_blank" rel="nofollow"></a>
Tony Chen
Ranch Hand

Joined: Jan 29, 2001
Posts: 286
What is this /css/nyk-style-00.css ? Where is it defined? In your web appliation (WAR)?

SCJP Java 2 - IBM Certified Enterprise Developer - WebSphere V4.0 & V5.0 - IBM Certified System Administrator - WebSphere Network Deployment V6.0 - Canadian Securities Course (CSC) Certification
Jason Kretzer
Ranch Hand

Joined: May 31, 2001
Posts: 280
I have found a solution besides calling the full path. When you run a JSP on the test server, the test server treats it as a servlet and as such the ../css/SomeCSS.css does not exist. It can be referenced from css/SomeCSS.css. Also, the paths of the links need to be adjusted as well.
Does anyone know if this is expected behavior? Will it act this way when it is deployed?
I agree. Here's the link:
subject: WSAD error accessing css in jsp
It's not a secret anymore!