This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
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
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

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.
 
GeeCON Prague 2014
 
subject: Path to JavaScript or CSS