Templates are interpreted on server side. Pages are included relative to where
your <insert> or <get> tag is located, not relative to the calling page. So, you
usually prefer to use absolute path rather than relative ones.

  Html tags, like <html:base/> or <html:img/> are interpreted on client side
(browser), so, they are relative to the result page, whose URL is generally the
same as the calling page.

  Cedric

DHarty wrote:

> I'm using templates, but I would prefer to "put" relative paths to the
> template vs. an absolute path.
>
> For example, a file using templates might look like:
>
>         <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
>         <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
>         <head><html:base/></head>
>
>         <template:insert template="../templates/template.jsp">
>
>                 <template:put name="body" content ="/body/body.jsp"/>
>
>         </template:insert>
>
> Whereas I'd rather send the realtive path to the template ala:
>
>                 <template:put name="body" content ="body.jsp"/>
>
> or even
>                 <template:put name="body" content ="../body.jsp"/>
>
> I can't seem to do this as the template always look for the file relative to
> its own location, and not the location of the calling file.
>
> Intestingly, if I put an <html:base/> tag in my template, the base it
> outputs is the location of the calling file.
>
> D

Reply via email to