Results 1 to 3 of 3
Thread: JSP/JSF and object paths
- 08-12-2011, 03:28 PM #1
Member
- Join Date
- Aug 2011
- Posts
- 2
- Rep Power
- 0
JSP/JSF and object paths
This is going to be a really stupid question but I have had this issue forever and I can never figure it out and I don't know if I am just missing some basic thing or something, so I apologize upfront.
I am pretty proficient in java and have been doing it for a while and I am somewhat of a novice when it comes to UIs, i.e. JSP, JSF, IceFaces, Zk, etc. I am constantly having an issue when I am trying to reference objects from a ,jsp/jsf page. Like linking to a style sheet or an image. I can never figure out the path to the object. I try the path that it is in in my project in eclipse, I try the path it is in from the page in the WAR, and I try to drag the object into the source of the jsp(eclipse) and it puts a path in there, NOTHING works. I always end up having to throw the images and style sheets in the same path as the page and referencing just the name of the file.
This is an extremely basic project just to test this. I am attaching a quick screen shot so you can see where they are in relationship to themselves. Also the href is /WEB-INF/classes/style.css because that is where it lies from the index.jsp in the war. If anyone can help me understand how to determine the paths or point me in the right direction would be greatly appreciated.Java Code:<head> <link href="/WEB-INF/classes/styles.css" rel="stylesheet" type="text/css"/> <title> <h:outputText value="#{msgs.windowTitle}"/> </title> </head>
- 08-18-2011, 03:48 PM #2
Member
- Join Date
- Aug 2011
- Posts
- 2
- Rep Power
- 0
Can anyone tell me what I'm doing wrong?
- 05-31-2012, 06:49 AM #3
Member
- Join Date
- Mar 2012
- Posts
- 41
- Rep Power
- 0
Re: JSP/JSF and object paths
/WEB-INF/classes is not an http or web directory , its part of the "J2EE container(java server)" specification.
both WEB-INF and classes are purely for the benefit of java servers regardless individualised applications in .war files(folders).
.css on the other hand is a totally web w3c specification in all web site disc zones and really is for the purpose of rendering html and xml. .css has nothing related to java server container structure excepting to know it should be referenced from an area of a java application the http://mysite.com/applicationname/my...ainpointer.jsp is in
e.g. http://mysite.com/mystylesheet.css
or http://mysite.com/stylesheetsall/mystylesheet.css
In the jakarta tomcat site they do show methods of referencing CSS style sheets in such places and transparently, but it is bad practice because it does not actually belong to(is irrelevent) java server container structure , only web markup xml and html specifications.
Similar Threads
-
Paths And Such
By han003 in forum New To JavaReplies: 6Last Post: 03-25-2011, 08:58 AM -
Paths
By N00Bie in forum New To JavaReplies: 5Last Post: 02-22-2011, 11:48 PM -
Paths in different os's
By hardcorebadger in forum New To JavaReplies: 7Last Post: 01-28-2011, 06:04 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks