I would also like to know why other tags (ie img) use a relative path to the
calling file, while the get tags do not.

For example the line in a template file:

        <html:img src="../graphics/picture.jpg"/>

render the path relative to the file that called the template (ex
/nested/body/body.jsp), whereas:

      <template:get name='body'/>

renders 'body' relative to the location of the template file>

D

-----Original Message-----
From: DHarty [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 25, 2001 3:39 PM
To: [EMAIL PROTECTED]
Subject: Templates and relative paths


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