Hello Günther, your solution made it easy to implement what the business guys wanted. However keep in mind that you could carry over the display tag parameters you desired by passing them over with the href. This saves you from struggling with lots of session data in memory.
This would of course require a special tag (see older posts in the user list) and will get complicated if you have very deep navigation structures. Anyway, if memory usage is not a major concern for you, your solution is much slicker. Regards Bastian -----Original Message----- From: Wutzl Günther [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 11, 2005 4:04 PM To: displaytag-devel@lists.sourceforge.net Subject: [displaytag-devel] Parameter caching Hi list My name is Guenther and I work in a project of a Telco Company in Austria. Our team uses the display-tag extensively and we would like to thank you for your cool project which saved us a lot of time. Recently we got a little CR from our business guys who wanted the displaytag-tables to remember pagenumber, sorting ... Therefore I patched two methods of your org.displaytag.util.DefaultRequestHelper: <code> public String getParameter(String key) { // actually simply return the parameter, this behaviour could be changed return this.request.getParameter(key); } public Integer getIntParameter(String key) { String value = this.request.getParameter(key); . . . </code> became <code> public String getParameter(String key) { HttpSession session = this.request.getSession(); String value = this.request.getParameter(key); boolean parameterCachingEnabled = true; if (parameterCachingEnabled) { // check if cache already exists HashMap cache = (HashMap) session.getAttribute(CACHE_KEY); if (cache == null) { cache = new HashMap(); session.setAttribute(CACHE_KEY, cache); } if (value == null) { // let's get the parameter from the cache value = (String) cache.get(key); } else { // let's put the parameter in the cache cache.put(key, value); } } return value; } public Integer getIntParameter(String key) { String value = getParameter(key); . . . </code> We would be very glad if you want to add this to displaytag. It's on you how to pass the parameterCachingEnabled flag to the method. We always needed the cache and wanted to modify as little as possible (for copy and paste upgrade reasons if you don't want to add these changes to future releases). Cheers, Guenther ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ displaytag-devel mailing list displaytag-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/displaytag-devel