Ahh
That can be StaticImageResource
private StaticImageResource(final Package basePackage, final String path, final Locale locale,
final String style)
{
// Convert resource path to absolute path relative to base package
this.absolutePath = Packages.absolutePath(basePackage, path);
this.locale = locale;
this.style = style;
this.application = RequestCycle.get().getApplication();
}
this application is needed. Because getResourceStream() can be called at moments in time when there is no RequestCycle (.get() == null)
This is because of the lastmodified/caching support in WicketServlet
But now i see that jonathan removed the getLastModified implementation!?
Now suddenly caching is going wrong again!
Why did you remove it jonathan?
getLastModified() must be implemented for caching. That is the most importand thing... So that there are right HEAD request and responses.
But this was the getLastModified:
protected long getLastModified(HttpServletRequest servletRequest)
{
final String pathInfo = servletRequest.getPathInfo();
if (pathInfo != null && pathInfo.startsWith(WebRequestCycle.resourceReferencePrefix))
{
final String resourceReferenceKey = pathInfo.substring(WebRequestCycle.resourceReferencePrefix.length());
final Resource resource = webApplication.getResource(resourceReferenceKey);
if (resource != null)
{
IResourceStream stream = resource.getResourceStream();
// first ask the length so the content is created/accessed
stream.length();
return stream.lastModifiedTime().getMilliseconds();
}
}
return -1;
}
And this is called without going through the get/post calls of the servlet.. And as you can see getResourceStream() is called there.
(so no request cycle is set)
This method has to be reintroduced so if we make application transient. Then we have to think of a reliable way to restore it
(getLastModified can be called first!)
johan
johan
Chris Turner wrote:
There is a potential bug related to using images (I think), which results in a non-transient reference to the application object being held by one of the objects in the session. I noticed it yesterday when trying to cluster the images example. I was trying to work out where the problem was before raising a bug - just haven't had time to do so yet. Perhaps you could raise the bug and I will append the detailed cause to it when I have found it.
regards, Chris
Gili wrote:
All of a sudden Tomcat started giving me exceptions on startup:
15:01:45,406 ERROR ManagerBase:636 - Exception loading sessions from persistent storage
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.be.desktopbeautifier.web.Application
[snip]
com.be.desktopbeautifier.web.Application extends WebApplication. Ideas?
Gili
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
