This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Path to JavaScript or CSS Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Path to JavaScript or CSS" Watch "Path to JavaScript or CSS" New topic
Author

Path to JavaScript or CSS

vinoth kumar v
Greenhorn

Joined: Sep 27, 2010
Posts: 6
How should i mention the path in my jsp page so that i can include css or js?

My Struts Structure

-WebInf
--CSS
---style.css
-failure.jsp


failure.jsp


I used the above code but iam not getting the css applied in my jsp.

Thanks in advance



[Thumbnail for Capture.JPG]

Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

The browser can't access files inside of WEB-INF directory directly. You'll have to move your CSS directory outside of the WEB-INF directory i.e. under the WebContent folder...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
vinoth kumar v
Greenhorn

Joined: Sep 27, 2010
Posts: 6
Hi I pasted the css in the web content and i changed my code as below



and



but still it doesnt work. It would be great if you provide me some example.

I like to have css and javascripts in seperate folder.

so please give an example assuming that it is in some folder
and also give me good programming practices of placing the css and js files in STRUTS appliction with example

thanks

vinoth kumar v
Greenhorn

Joined: Sep 27, 2010
Posts: 6
Iam still facing the issue.
Can anyone help me on this.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Path to JavaScript or CSS
 
Similar Threads
project file structure for web application (war).
including a css file to a jsp from another folder
Not JSP. Anyone know how to just use .html files
How to Set Character Encodeing in JSP
Error "HTTP Status 404 - Invalid path /products was requested"