tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Shmays" <>
Subject Work Around Ideas
Date Mon, 13 Jan 2003 20:40:05 GMT
I upgraded to Tomcat 3.x, but I seem to be experiencing a problem with
one piece of application. I was wondering if anyone could help me
brainstorm some ideas.  In our application we had a requirement for a
custom "back button" they way we have implemented it in the past was by
stacking HttpServletRequest objects onto a java.util.Stack during a
service() method of the servlet. When a back command came in we just
poped the old HttpServletRequest out and ran that through instead. Now
that HttpServletRequest implementation has changed the code no longer
works since the request is no longer a "stateful, stand-alone" object.
Any suggestions? 
        try {
            ....Application code

            //  Check for requests to traverse backwards on stack
            StackItem si = null;
            StackItem sii = null;

            if ("goBack".equals(request.getParameter("op")) {
                Stack stack = (Stack)m_storeService.get(requestContext,
                if (stack != null) {
                    try {
                        // Phantom pop discards current page. If second
                        // pop overruns stack, si is still set to
current page!
                        si = (StackItem)stack.pop();
                        sii = (StackItem)stack.pop();
                        si = sii;
                    catch (EmptyStackException esex) {
                        // This changes flow, but need not be acted upon
(see last note)
                    request = si.getRequest();

              .... Use the resulting request instead...
              ... App Code ...
Michael Shmays

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message