You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Entropy <bl...@gmail.com> on 2014/07/31 15:24:43 UTC

Excel spreadsheet and cache duration

We have an ajax button that submits a form that, if the parameters are right,
will download an excel file.  The developers who wrote the page used an ajax
behavior and then write the request out as javascript like so:

target.appendJavaScript((CharSequence) ("window.location.href='" +
getCallbackUrl() + "';"));

After building the byte array resource and sticking it in place via:

getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(new
ResourceRequestHandler(rptRS, null));

The problem with this is that when a person changes the parameters and
resubmits the form to get a different dynamically generated excel, there's
some caching in play and they get the same one they downloaded earlier.  

We put getResourceSettings().setDefaultCacheDuration(Duration.NONE); in the
application init and it seemed to solve it.  But setting to no cache for the
whole app seems like overkill.  We'd like to set it for this one download. 
I've seen forum posts that suggest there is a setCacheDuration on some
specific objects, but none of the ones I seem to try.

How would I set the cache to none for THIS object/URL?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Excel-spreadsheet-and-cache-duration-tp4666828.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Excel spreadsheet and cache duration

Posted by "Urbani, Edmund" <ed...@lilandit.com>.
My guess is that whatever browser you are using is trying to PROPFIND for more 
information about the file. And yes, that method is commonly used by WebDAV 
capable servers and will usually result in HTTP status code 405 otherwise.

That would make it a WAS7 / browser issue and not a Wicket problem. I would try 
the WAS docs to find a way to prevent these from being logged...

On 07/31/2014 04:51 PM, Entropy wrote:
> That workaround had occurred to us.  We thought there might be a better way,
> but if that is the recommended solution, we feel better about it.  Just
> didn't want to overlook a silver bullet.
>
> While it isn't the exact same thing, I am also having an exception maybe
> someone could shed light on in the same process.  This happens as we
> download the file.  In fact, not until we select Opn/Save in the browser.
> This app was recently upgraded from 1.4 to 1.6, and we're fairly sure this
> error didn't used to happen.
>
> Note that it doesn't seem to actually stop the app from working, just
> pollute the logs.  The feature still works.  Any ideas?  We're using WAS7,
> and I've seen some google hits saying this is about something called WebDAV
> and WAS 7 doesn't support it.
>
> [7/31/14 10:38:51:822 EDT] 00000018 webapp        E
> com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet
> Error]-[Wicket]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: Method
> PROPFIND is not defined in RFC 2068 and is not supported by the Servlet API
> 	at
> com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:637)
> 	at
> com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:1187)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
> 	at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
> 	at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
> 	at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
> 	at
> com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
> 	at
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
> 	at
> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
> 	at
> com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
> 	at
> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
> 	at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
> 	at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
> 	at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
> 	at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
> 	at
> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
> 	at
> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
> 	at
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
> 	at
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
> 	at
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
> 	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
> 	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
> 	at
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
> 	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
> 	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Excel-spreadsheet-and-cache-duration-tp4666828p4666831.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


-- 

Mit freundlichen Grüßen
Edmund Urbani
Liland IT Team

Email: Edmund.Urbani@Lilandit.com <ma...@lilandit.com>

Liland IT GmbH ...does IT better
Tel: +43 463 220111
Fax: +43 463 220111-33
Tel(GER): +49 221 65028588

Find us at Facebook http://facebook.com/Lilandit
http://green-badges.com
http://iventcloud.com
http://Lilandit.com

<http://www.LilandIT.com> <http://www.LilandIT.com>

Copyright © 2013, Liland IT GmbH

Diese Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese Email irrtuemlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.

This email may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this email in error) 
please notify the sender immediately and destroy this email. Any unauthorised 
copying, disclosure or distribution of the material in this email is strictly 
forbidden.


Re: Excel spreadsheet and cache duration

Posted by Entropy <bl...@gmail.com>.
That workaround had occurred to us.  We thought there might be a better way,
but if that is the recommended solution, we feel better about it.  Just
didn't want to overlook a silver bullet.

While it isn't the exact same thing, I am also having an exception maybe
someone could shed light on in the same process.  This happens as we
download the file.  In fact, not until we select Opn/Save in the browser. 
This app was recently upgraded from 1.4 to 1.6, and we're fairly sure this
error didn't used to happen.

Note that it doesn't seem to actually stop the app from working, just
pollute the logs.  The feature still works.  Any ideas?  We're using WAS7,
and I've seen some google hits saying this is about something called WebDAV
and WAS 7 doesn't support it.  

[7/31/14 10:38:51:822 EDT] 00000018 webapp        E
com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet
Error]-[Wicket]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: Method
PROPFIND is not defined in RFC 2068 and is not supported by the Servlet API 
	at
com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:637)
	at
com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:1187)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
	at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
	at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
	at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
	at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
	at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
	at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
	at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Excel-spreadsheet-and-cache-duration-tp4666828p4666831.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Excel spreadsheet and cache duration

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Append some random noise to the download URL. See NonCaching image as
example.


On Thu, Jul 31, 2014 at 3:24 PM, Entropy <bl...@gmail.com> wrote:

> We have an ajax button that submits a form that, if the parameters are
> right,
> will download an excel file.  The developers who wrote the page used an
> ajax
> behavior and then write the request out as javascript like so:
>
> target.appendJavaScript((CharSequence) ("window.location.href='" +
> getCallbackUrl() + "';"));
>
> After building the byte array resource and sticking it in place via:
>
> getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(new
> ResourceRequestHandler(rptRS, null));
>
> The problem with this is that when a person changes the parameters and
> resubmits the form to get a different dynamically generated excel, there's
> some caching in play and they get the same one they downloaded earlier.
>
> We put getResourceSettings().setDefaultCacheDuration(Duration.NONE); in the
> application init and it seemed to solve it.  But setting to no cache for
> the
> whole app seems like overkill.  We'd like to set it for this one download.
> I've seen forum posts that suggest there is a setCacheDuration on some
> specific objects, but none of the ones I seem to try.
>
> How would I set the cache to none for THIS object/URL?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Excel-spreadsheet-and-cache-duration-tp4666828.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro

Re: Excel spreadsheet and cache duration

Posted by Martin Grigorov <mg...@apache.org>.
On Jul 31, 2014 4:25 PM, "Entropy" <bl...@gmail.com> wrote:
>
> We have an ajax button that submits a form that, if the parameters are
right,
> will download an excel file.  The developers who wrote the page used an
ajax
> behavior and then write the request out as javascript like so:
>
> target.appendJavaScript((CharSequence) ("window.location.href='" +
> getCallbackUrl() + "';"));
>
> After building the byte array resource and sticking it in place via:
>
> getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(new
> ResourceRequestHandler(rptRS, null));

See what is the type of this null here. You can use it to add the
randomness.

>
> The problem with this is that when a person changes the parameters and
> resubmits the form to get a different dynamically generated excel, there's
> some caching in play and they get the same one they downloaded earlier.
>
> We put getResourceSettings().setDefaultCacheDuration(Duration.NONE); in
the
> application init and it seemed to solve it.  But setting to no cache for
the
> whole app seems like overkill.  We'd like to set it for this one download.
> I've seen forum posts that suggest there is a setCacheDuration on some
> specific objects, but none of the ones I seem to try.
>
> How would I set the cache to none for THIS object/URL?
>
> --
> View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Excel-spreadsheet-and-cache-duration-tp4666828.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>