Trouble adding css to javaEE project

Answered

I really don't know why the 2 commented lines about adding the css file doesn't work as the third one does...

 

0
7 comments

Hello,

Please try relative path "../../inc/styleFormu.css". Also check https://stackoverflow.com/questions/12344406/style-paths-in-java-ee-applications

0
Avatar
Permanently deleted user

Here is all I tried but nothing works... Seems the file doesn't exists but it's in the out folder anyway.
The file taglibs.jsp is yet working.
I really don't understand, maybe it's from settings or project structure?

 

0

Works fine with my test project. Please try to move .jsp outside "WEB-INF" folder.

0
Avatar
Permanently deleted user

But what's the point of having WEB-INF folder if you cannot place anything in it?
Is there no other option to use jsp with external ressources?

There is a lot of problems like that in the net, but I can't find a proper answer...

 

0

You placed index.jsp in /WEB-INF folder. This way it is not publicly accessible without calling through a front controller servlet.

The Servlet 2.4 specification says this about WEB-INF (page 70):

A special directory exists within the application hierarchy named WEB-INF. This directory contains all things related to the application that aren’t in the document root of the application. The WEB-INF node is not part of the public document tree of the application. No file contained in the WEB-INF directory may be served directly to a client by the container. However, the contents of the WEB-INF directory are visible to servlet code using the getResource and getResourceAsStream method calls on the ServletContext, and may be exposed using the RequestDispatcher calls.

1
Avatar
Permanently deleted user

Ok, ok...
I had no index, it was an annotation redirecting directly in a WEB-INF jsp through a servlet.
I solve this before your last answer by using filters, but I now begin to understand how it works...

Need more practise!!
By the way, thank you for your help!!


I don't know how to mark this post as completed...

 

0

Sorry, it should be "formu.jsp", not "index.jsp". Nice to hear that it works now. There is no need to add any marks to the post.

0

Please sign in to leave a comment.