Today I found that:
Content-Disposition: attachment;filename=document.pdf
can NOT be changed to
Content-Disposition: inline;filename=document.pdf
It MUST be
Content-Disposition: inline
without the filename - if you want it to work in IE.
Got the idea after reading:
http://indiwiz.com/2009/03/11/forcing-http-download/
Reading a bit more in http://www.ietf.org/rfc/rfc2183.txt
I found my dynamic download to work nice when these headers where set:
Content-Type:
Content-Disposition:
"Computers are like Old Testament gods; lots of rules and no mercy."
- Joseph Campbell
Friday, September 18, 2009
Thursday, September 3, 2009
zktodo2 failed - but fixed again
I've installed NetBeans 6.7.1 on Ubuntu running on my Sun VirtualBox. Preferred to do so in stead of messing up my own computer ...
Got subversion and maven2 installed by using some magical
sudo apt-get commands ;-)
Got the zktodo2 installed by running mvn co (checkout).
Got the a nice dependency graph to display - WOW!!
http://mediacast.sun.com/users/ken_g/media/maven-dependecies-screencast/
fixed an error and got the project to build.
But the deployment failed with an error telling me that the
element type "listener" must match "(listener-class)"
Found the reason here:
http://www.coderanch.com/t/82686/Tomcat/listener-listener-class
So I changed the head of my web.xml from:
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
to:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
and it worked!
Now I can go home and tell my wife tonight - and I am sure she'll fall asleep at once ;-)
P.S.
So I took an exported appliance home - and imported my new environment into the VirtualBox on my laptop. And it did not work!
Could not create the entity manager! Clean and build - then run. Nope - still problems! I had to undeploy the context, then redeploy - to make it work.
Got subversion and maven2 installed by using some magical
sudo apt-get commands ;-)
Got the zktodo2 installed by running mvn co (checkout).
Got the a nice dependency graph to display - WOW!!
http://mediacast.sun.com/users/ken_g/media/maven-dependecies-screencast/
fixed an error and got the project to build.
But the deployment failed with an error telling me that the
element type "listener" must match "(listener-class)"
Found the reason here:
http://www.coderanch.com/t/82686/Tomcat/listener-listener-class
So I changed the head of my web.xml from:
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
to:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
and it worked!
Now I can go home and tell my wife tonight - and I am sure she'll fall asleep at once ;-)
P.S.
So I took an exported appliance home - and imported my new environment into the VirtualBox on my laptop. And it did not work!
Could not create the entity manager! Clean and build - then run. Nope - still problems! I had to undeploy the context, then redeploy - to make it work.
Wednesday, September 2, 2009
svn - remain in conflict
A folder was marked as in conflict ... don't know why!
I had to go to dos prompt and finally found that
> svn info
told me about a conflict properties file ... so I deleted this!
Then I could commit again ;-)
I had to go to dos prompt and finally found that
> svn info
told me about a conflict properties file ... so I deleted this!
Then I could commit again ;-)
Tuesday, September 1, 2009
URL to pdf-documents with search parameter
I have a servlet that reads my blob with the pdf content and used the response.setHeader to set the Content-Disposition and assign a filename. Nice!
So I was looking for a way to pass a search parameter to the PDF viewer ...
I found the spec:
www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf
so I thought I had to use something similar to post on the http header ...
But NO!
All I had to do was to put it on my URL, and that was it!
so my .../document?id=NR should just be .../document?id=NR#search=THIS
Why did it take so long to find out?
Because it DID NOT WORK in FireFox! I tested in IE and it worked.
I tested in Opera and Chome - and it worked.
So I was looking for a way to pass a search parameter to the PDF viewer ...
I found the spec:
www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf
so I thought I had to use something similar to post on the http header ...
But NO!
All I had to do was to put it on my URL, and that was it!
so my .../document?id=NR should just be .../document?id=NR#search=THIS
Why did it take so long to find out?
Because it DID NOT WORK in FireFox! I tested in IE and it worked.
I tested in Opera and Chome - and it worked.
Subscribe to:
Posts (Atom)