ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Schrader" <tschra...@gmail.com>
Subject Re: Using com.ibaits.struts to work with files in the web application
Date Mon, 24 Apr 2006 16:25:01 GMT
Hi Meindert,

Are you trying to retrieve the ServletContext() from a Struts Action
subclass?  If so, then you can start with the request object passed
into the execute method:

    public ActionForward execute(
        ActionMapping mapping,
        ActionForm form,
        HttpServletRequest request,
        HttpServletResponse response)
        throws Exception
    {
        ServletContext context = request().getSession().getServletContext();

        // do other stuff

       return mapping.findForward("success");
    }

Ted


On 24/04/06, Meindert <meindert@pastelebusiness.com> wrote:
> Hi Ted,
>
> Wasn't to sure if it was the right spot to ask, but thought I could post it
> here because the 'problem' was with the ibatis struts.
>
> The context for my servlet is under;
> ServletContext context =
> ActionContext.getActionContext().getRequest().getSession().getServletContext
> ();
>
> Thanks for the help
>
> MEINDERT HOVING
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.4.4/319 - Release Date: 19/04/2006
>
>
>

Mime
View raw message