• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with the Contextpath in the url

 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried configuring the MIME type for *.xls in your web.xml?
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic