This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Context Path Issue in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Context Path Issue in Struts" Watch "Context Path Issue in Struts" New topic
Author

Context Path Issue in Struts

Sreekanth Kalakanti
Greenhorn

Joined: Sep 09, 2009
Posts: 12
I am working on Struts application, we are having application resources files(app.xml) file in resources folder of My Struts application, so i need to read this file

we are able to get the reader Object here in local System Jboss Server but in Main Server its not working i even tried



but the context path i am getting is http:/100.100.20.14:8080/abc/resources/app.xml i.e after http i am getting only one / i.e(http:/) so can any one can guide me in right path


Regards,
Sreekanth
Shinelin Samuel
Ranch Hand

Joined: Mar 01, 2010
Posts: 55
Sreekanth,

Any reason to use http url (with hostname and port)?, I believe you can directly load your property file using the directory path in your Server host (i.e if it is unix host it will be something like this -> /root dir/<appDeploymentpath>/resources/app.xml )
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 650
Look into the getResourceAsStream method of the ServletContext object.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Context Path Issue in Struts
 
jQuery in Action, 3rd edition