From: "Morgan Delagrange" <[EMAIL PROTECTED]>
> I didn't mean to issue a proclamation here.  :)  Are there dissenting
> views to handling relative paths via getResource(), or is this silent
> consent?  I'll probably go ahead and implement getResource() if there are
> no immediate objections, but we can easily change it before the release.

I actually just went through these kind of issues with the XTags library.
The <xtags:parse> tag can parse its body, a URL or a URI to a resource or
the result of calling some dynamic page or external web service.

If it helps any, here's the decision I came to:-

* parsing the body

    <xtags:parse>
        <root>
            <child/>
        </root>
    </xtags:parse>

* parsing an absolute URL via the "url" attribute

    <xtags:parse url="http://something.com"/>

* parsing a web app resource using an absolute URI relative to the web-app
context using the "uri" attribute

    <xtags:parse uri="/data/foo.xml"/>

* parsing a web resource using a URI relative to the the current JSP

    <xtags:parse uri="foo.xml"/>

So thats the basics covered in 2 attributes. Then for more complex
requirements such as parsing the output of a piece of JSP, when we get to
JSP 1.2, we'll be able to do...

    <xtags:parse>
        <jsp:include page="foo.jsp"/>
    </xtags:parse>

until then I use the IO tag library to make these requests such as...
(though they are in a seperate http request so all session, request & page
scope state is lost)

    <xtags:parse>
        <io:request url="/foo.jsp"/>
    </xtags:parse>

if it must be in the same request, its a hack but this usually works (if
scripting variables don't clash)

    <xtags:parse>
        <%@ include file="/foo.jsp" %>
    </xtags:parse>

or to parse the output of an XML-RPC call...

    <xtags:parse>
        <io:xmlrpc url="/xmlrpc_echo.jsp">
         <io:pipe>
          <methodCall>
             <methodName>examples.getStateName</methodName>
             <params>
                <param>
                   <value><i4>41</i4></value>
                   </param>
                </params>
             </methodCall>
         </io:pipe>
        </io:xmlrpc>

    </xtags:parse>

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to