• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Referring Script outside WEB-INF

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
below is my Project folder structure

contextroot/scripts/temp.js
contextroot/stylesheets/layoutStyles.css
contextroot/WEB-INF
contextroot/WEB-INF/JSP/temp.jsp

i tried to use the stylesheet in a temp.jsp page inside JSP folder,
i referred the stylesheet as


but it is not referred. the same case with the script file...
is there any problem in referring the source outside the WEB-INF.

Any pointers would appreciated...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that you should avoid relative paths,
and use absolute paths instead.
Like /scripts/temp.js
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
...
Like /scripts/temp.js


That won't work either.
The preceding slash tells the browser that this link is realative to the domain (the context path will be skipped).

Your best approach is to read the context path from the request object and then build your link; relative to that.

JSP.2.0:


Legacy:

[ July 13, 2006: Message edited by: Ben Souther ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic