Getting the context path in jsp is something struts doesn't really
support--something I've had trouble with many times. One way to get around
the problem is scriptlet like Jim showed you. Recently, we used url tag for
the same purpose:

<s:url id="saveImg" value="/images/save.gif" />

<s:submit type="image"  src="%{saveImg}" />

On Tue, Apr 29, 2008 at 3:22 PM, Jim Kiley <[EMAIL PROTECTED]> wrote:

> I did something like src="<%=request.getContextPath()%>/images/header.gif"
>
> On Tue, Apr 29, 2008 at 12:51 AM, Yellek <[EMAIL PROTECTED]> wrote:
>
> >
> > I am trying to write an image button of the form:
> >
> > <s:submit type="image" src="context-root/images/search1.gif"
> > name="search"/>
> >
> > where context-root is the configured context root of my web application.
> > Can
> > anyone suggest a good way to dynamically populate the context root?
> >
> > I am assuming that the src string is being interpreted via OGNL but I
> > can't
> > figure out an appropriate expression to use to extract the context root
> > from
> > the request.
> >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/Context-Root-for-Image-Button-src-attribute-tp16952908p16952908.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>

Reply via email to