Session expired on resources?

I have two questions regarding session timeouts on resources:

  • When I open a resource without having a session, I’m not redirect to the homepage. Can I fix this?
  • When I copy a resource URL for a PDF in Adobe Reader I get a nasty error message and a nasty error in the server logs. Can I show a nicer error message in Reader? And how can remove them from my server logs (or give them less severity so I can filter them)?

background information:

After an 4 hour debugging and trying-out-various-things session I’ve finally figured out what was causing the following error message in my server logs:

/APP/8/xxxxxxxxxx-878012.pdf
java.lang.reflect.UndeclaredThrowableException
	at $Proxy12.sendRedirect(Unknown Source)
	at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleServiceSessionExpired(AbstractApplicationServlet.java:1128)
	at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:544)
	at com.vaadin.terminal.gwt.server.GAEApplicationServlet.service(GAEApplicationServlet.java:190)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
... and many lines more, please let me know if you want to see these

First I tried to open a resource without a session. The result is I get to see the application homepage. I’m not redirected as I would have thought, because I still see the resource URL in my browser bar.

Taking this a step further, I then pasted the url in the “open” dialogue of Adobe Reader and hit the jackpot: I saw the above stacktrace in my server logs and Reader gave me an angry message.