Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Context Path  RSS feed

 
Ritesh Mehta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wish to separate customer specific jsp codes in different directory. All jsps are stored in a directory "/jsp".
Within this there is another directory "cust_jsp" , where I moved the customer specific code. This customer code links to other jsps in the parent directory (/jsp).

When I visit the customer specific code and then try to go to other link, it tries to look for them in the current directory. What I want, is that it should look for any hyperlinks from the web-apps root directory.

I guess, I can use request.getContextPath() and then append this in front of the hyperlinks. But doing this would require a lot of change in the application.

Is there any other way, where i can set the context path to the root so it looks for the files from the web-apps root directory.

Thanks for your help.

RM
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ritesh,
For any links to jsps under cust_jsp, use the absolute path.
For ex, if any JSP in /JSP folder is refering to cust_jsp, give absolute path from root, like /APPLICATION_ROOT/jsp/cust_jsp/first.jsp
This should resolve the issue.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might also investigate using the <base> tag in your pages to set the relative reference point.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!