You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Thomas Fahrmeyer <th...@einsurance.de> on 2001/02/08 12:34:18 UTC

VelocityServlet extension

Hi,

I would be very nice if the VelocityServlet calls a "clean up" method at the
end of doRequest.

finally
        {
            try
            {
                if (vw != null)
                {
                    vw.flush();
                    writerPool.put(vw);
                    output.close();
                }
            }
            catch (Exception e)
            {
                // do nothing
            }
		//user defined clean up method
		cleanUp();
        }

I see the need in my application, but I think it could be a common need. I
have a object that is stored in the session. The presentation servlet reads
the value put it into the context, so the template can use this object. But
after the template was displayed I want to remove this object from the
session. Therefore I need the clean-up hook ;)

It is a common need ? I think it's always good to give a application a
chance to clean up some ressources.

Thomas





RE: VelocityServlet extension

Posted by Thomas Fahrmeyer <th...@einsurance.de>.
I forgotten something.

cleanUp(HttpServletRequest request) to obtain the session. I think thats
call is even more usefull than the parameter less one.

Thomas


> -----Original Message-----
> From: Thomas Fahrmeyer [mailto:thomas.fahrmeyer@einsurance.de]
> Sent: Thursday, February 08, 2001 12:34 PM
> To: Velocity-Dev
> Subject: VelocityServlet extension
>
>
> Hi,
>
> I would be very nice if the VelocityServlet calls a "clean up"
> method at the
> end of doRequest.
>
> finally
>         {
>             try
>             {
>                 if (vw != null)
>                 {
>                     vw.flush();
>                     writerPool.put(vw);
>                     output.close();
>                 }
>             }
>             catch (Exception e)
>             {
>                 // do nothing
>             }
> 		//user defined clean up method
> 		cleanUp();
>         }
>
> I see the need in my application, but I think it could be a common need. I
> have a object that is stored in the session. The presentation
> servlet reads
> the value put it into the context, so the template can use this
> object. But
> after the template was displayed I want to remove this object from the
> session. Therefore I need the clean-up hook ;)
>
> It is a common need ? I think it's always good to give a application a
> chance to clean up some ressources.
>
> Thomas
>
>
>
>