aspose file tools*
The moose likes Struts and the fly likes Problem with the Contextpath in the url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with the Contextpath in the url" Watch "Problem with the Contextpath in the url" New topic
Author

Problem with the Contextpath in the url

sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

I am facing a problem which i am not able to get the complete solution .In my web application i have a folder(this folder name is not fixed ) and inside that i have a HTML page which has images . i am opening that file using an action ( i am not directly opening this as i cant handle filenotfound exceptions and all ) ......and the problem here is i am not getting the images as the browser is looking in for images directly under my context .

my action for opening the doument looks like this
http://localhost:8080/myapp/openfile.do?path= variblefoldername/filename

and in my action class i am just opening that using new ActionForward(path) ..............so in the url as this is a forward and i tries making it a redirect so that url gets updated as http://localhost:8080/myapp/variablefoldername/filename and this works fine but there is a problem with the Excel file as content type in header gets lost on using a redirect .Hence junk comes for Excel file .................


so can any give me a solution for this
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Have you tried configuring the MIME type for *.xls in your web.xml?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
hi

thanks its working now with that entry in applications web.xml.............earlier i tried by adding this in tomcat\conf\web.xml and this was not working
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with the Contextpath in the url