This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

For Tomcat 5.5.23 on Linux Gurus.

 
Todd Baxter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to be able to serve JSPs of a webapp from within a war as well as outside of it. Some JSPs which are core are part of the war and some JSPs which are customer driven (and have nothing to do with core) are deployed in a different directory. However, I want to be able to access those external JSPs
seamlessly just like I'm accessing the JSPs in the war.

Is there a trick I can use to make Tomcat 5.5.23 (on Linux) to make Tomcat
serve JSPs from this external directory. I have looked at the allowLinking feature of the <Context> but can't quite get to work.
 
Tarun Yadav
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Todd Baxter:
I need to be able to serve JSPs of a webapp from within a war as well as outside of it. Some JSPs which are core are part of the war and some JSPs which are customer driven (and have nothing to do with core) are deployed in a different directory. However, I want to be able to access those external JSPs
seamlessly just like I'm accessing the JSPs in the war.

Is there a trick I can use to make Tomcat 5.5.23 (on Linux) to make Tomcat
serve JSPs from this external directory. I have looked at the allowLinking feature of the <Context> but can't quite get to work.


Are these other JSPs you mention in another webapp? Because I don't know how else it would work. So, you need cross context access? You can set the crossContext attribute of <Context> equal to "true".

Then, you can get the other webapp's context with a call to getServletContext("/myOtherApp") and work with that.
 
Todd Baxter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No these are not in a different web-app. What I'm looking for is a way to do virtual mapping ala JRun style.

Something like

<virtual-mapping>
<resource-path>/pages</resource-path>
<system-path>/wherever/on/the/harddisk/pages</system-path>
</virtual-mapping>

This person's post is similar to what I'm asking.

http://marc.info/?l=tomcat-user&m=107791455306590&w=2
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic