You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Maxim Kondakov (JIRA)" <ji...@apache.org> on 2010/03/26 08:32:27 UTC

[jira] Updated: (WICKET-2804) expired page with using bundle of js scripts as resources

     [ https://issues.apache.org/jira/browse/WICKET-2804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maxim Kondakov updated WICKET-2804:
-----------------------------------

    Attachment: JScriptReferenceCache.java

this is class we using for attaching dynamic js resources

> expired page with using bundle of js scripts as resources
> ---------------------------------------------------------
>
>                 Key: WICKET-2804
>                 URL: https://issues.apache.org/jira/browse/WICKET-2804
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.7
>         Environment: Windows 2k3 Server, WebSphere Comminity Edition 1.0.1
>            Reporter: Maxim Kondakov
>             Fix For: 1.3.8
>
>         Attachments: JScriptReferenceCache.java
>
>
> When i using dynamic resource with long size content (JavaScript), i often getting "Expired page" situation. So, i trying next part of code:
> on my page i creating makup and code:
>           this.add(MyClass.getResourceLink(session, "userScript"));
> in MyClass i have:
>          bundles = "longggggg string";
>          return new BundleResource(session, session.getApplication().getRequestCycleSettings().getResponseRequestEncoding(), bundles);
> private class BundleResource extends WebResource {
>         private StringBuilder script;
>         private String encoding;
>         public BundleResource(SignInSession session, String encoding, Map<String, String> scripts) {
>             script = new StringBuilder(scripts);
>             this.encoding = encoding;            
>         }
>         @Override
>         public IResourceStream getResourceStream() {
>             StringResourceStream s = new StringResourceStream(script.toString(), "text/javascript");
>             s.setCharset(Charset.forName(encoding));
>             return s;
>         }
>     }
> when bundles is long string, something about 4Mb, i always catch expired page after 4-5 clicks (reload my page). When string is empty it is't happening.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.