The following is my example Servlet Code, the only thing I want to do is config 
treecache to let it run on tomcat 5.0.19. Is it wrong?

public class CacheServlet extends HttpServlet {

        private TreeCache cache;

        protected void doGet(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException, 
IOException {
                perform(request, response);
        }

        private void perform(HttpServletRequest request,
                        HttpServletResponse response) {
                try {
                        cache.put(Fqn.fromString("/a/b/c/d"), "key", "value");
                } catch (Exception e) {
                        e.printStackTrace();
                }
        }

        protected void doPost(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException, 
IOException {
                perform(request, response);
        }
        public void destroy() {
                cache.stopService();
                cache = null;
                super.destroy();
        }
        public void init(ServletConfig config) throws ServletException {
                try {
                        cache = new TreeCache();
                        cache.createService();
                        cache.startService();
                } catch (Exception e) {
                        e.printStackTrace();
                }

        }
}

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3853013#3853013

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3853013


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to