File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes PDF Download not working in Production. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "PDF Download not working in Production." Watch "PDF Download not working in Production." New topic
Author

PDF Download not working in Production.

Yogendra Singh Butola
Greenhorn

Joined: Sep 28, 2011
Posts: 13
In my Spring MVC based application, I've implemented a PDF viewer functionality. This functionality is working in DEV, TEST, and STAGE, however it's not working in production.

Following are the details.

1 In web.xml the servlet is separately defined as :

<servlet>
<servlet-name>DowloadPDF</servlet-name>
<servlet-class>com.work.pa.DownloadPDF</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>DowloadPDF</servlet-name>
<url-pattern>/downloadPDF.do</url-pattern>
</servlet-mapping

2. Servlet code

httpSession = request.getSession();
byte[] pdfAsByteArray = (byte[]) httpSession.getAttribute("pdfObject");
response.setHeader("Pragma", "no-cache");
response.setHeader("Expires", "0");
response.setContentType("application/pdf");
response.setHeader("Content-disposition", "attachment; filename=document.pdf");
response.setContentLength(pdfAsByteArray.length);
OutputStream os = response.getOutputStream();
os.write(pdfAsByteArray);
os.flush();
os.close();
response.reset();


This works in DEV, TEST, and STAGE, however in Production it's not working.
Following is the URL for production:

https://bet.rab.com/Rabbit/downloadPDF.do
HOWEVER,
it works in production if change the URL to

http://dbnrt355:9081/Rabbit/downloadPDF.do

I've changed https to http and given the exact name of the server along with the port number.


Any help will be highly appreciated.





Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29261
    
140

Does qa use https? If not, your problem is the https setup. If so, what is different between the two.

There isn't really enough information here to be able to suggestion solutions.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PDF Download not working in Production.
 
Similar Threads
Simple JPA application on TOMEE
Getting MethodMissingException on trying to run groovy class
JSF 2.0 MyConverter.getAsObject(...) how to get a handle on the backing bean
hibernate 4 and spring 3.1.2 issue with LocalSessionFactoryBuilder