Hello I have a servlet which will open up a word document when given the URL for a doc file located on the server. However I would like it so that if the document URL is invalid it would display an HTML error page, however it still opens up Word and displays the error info there. I have a solution to this however it would require me to create a seperate JSP page to handle the errors. I am wondering can the servlet handle handle both Word docs and display error info on the browser. I set the servlet content type to open up the responses in the MSWord app. is there another way around this?? Do I have to redirect the response to a seperate JSP page to handle errors?? here is the line I mentioned:
Sudhir Howale
Greenhorn
Joined: Aug 18, 2003
Posts: 4
posted
0
Hi! Cant you set the response type depending on the validity of the URL. I mean to say, if you want to throw a normal HTML error page then you can not set the repsonse type as (application/msword). I havent seen your code, but the flow should be if(valid(URl) then { normal processing } else ( set the response type as html and throw html error page } Do write me , if i have misunderstood something... Sudhir H
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
Sudhir is saying that somehow you have to be able to determine if the URL is valid or not before attempting to open the word doc. Based on your posting, it seems like you are determining that the doc URL is invalid if the doc can not be found.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley