[ http://mc4j.org/jira/browse/STS-302?page=comments#action_10757 ] 
            
Sebastian Hennebrueder commented on STS-302:
--------------------------------------------

In the 1.5 code the session problem was fixed.



> Layout renderer performance improvements & corrections
> ------------------------------------------------------
>
>                 Key: STS-302
>                 URL: http://mc4j.org/jira/browse/STS-302
>             Project: Stripes
>          Issue Type: Improvement
>          Components: Tag Library
>    Affects Versions: Release 1.4.1
>            Reporter: Denis Ivaikin
>         Assigned To: Tim Fennell
>
> net.sourceforge.stripes.tag.layout.LayoutRenderTag - doEndTag() does the 
> following:
> URL target = request.getSession().getServletContext().getResource(this.name);
> This forces servlet container to create the new session if none exists which 
> might be not desirable if the page does not uses sessions at all (page 
> session="false" directive). It's possible to get the servlet context through 
> the getPageContext().getServletContext().
> Another issue is the getResource() performance penalty, this method triggers 
> check if the file exists on the local file system, which is quite slow. Since 
> there are few layouts in the application, it's possible to use the Map 
> between the page name & URL.
> So, I've made a minor patch which allocates the static Map
> private static ConcurrentMap<String, URL> targetMap = new 
> ConcurrentHashMap<String, URL>();
> And uses it like this
> if (!targetMap.containsKey(this.name)) targetMap.put(this.name, 
> getPageContext().getServletContext().getResource(this.name));
> URL target = targetMap.get(this.name);
> Which actually gives some performance benefit. However, some pages in the 
> application might be deleted in runtime, so, this method could give the false 
> positive. It could be possible to refresh the map periodically or use some 
> kind of listener.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://mc4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to