Hi,
On Thu, Jul 31, 2008 at 7:52 AM, janandith jayawardena
<[EMAIL PROTECTED]> wrote:
> ...There are the following properties(options) in the taglib.tld for JSP tags
> in sling....
I assume you mean sling:include, as the only other tag is
sling:defineObjects which has different attributes.
> ...I can't understand how to avoid using path and use resource instead for
> <sling:include /> tag....
<sling include resource="..."/> is used when your script has a
Resource object that it wants to include.
Something like
Resource r = resource.getResourceResolver().getResource("/foo/bar");
%><sling:include resource="<%= r %>"/><%
> ...I've also tried to understand the replaceSuffix , replaceSelectors using
> the
> table given in
>
> http://incubator.apache.org/sling/site/sling-api.html ....
replaceSelectors is similar to addSelectors that you have used, but
instead of adding new selectors to the request it replaces them. So if
your original request was /foo/bar.print.a4.html, <sling:include
replaceSelectors="a.b"/> will cause the included resource to get "a.b"
as selectors, whereas <sling:include addSelectors="a.b"/> will cause
it to get "print.a4.a.b".
> ..Also I've uploaded selector.img file and tried to change the extension to
> selector.txt using replaceSuffix but haven't been able to get it working....
replaceSuffix will not change the extension of anything, it replaces
the suffix in the included request, in the same way than
replaceSelectors. To experiment with this I'd suggest using
SlingHttpServletRequest.getRequestPathInfo().getSuffix() in a script
(for example displaying that value to the output), and using this
script to process a resource included with <sling:include>. Actually,
creating a script that outputs all of the getRequestPathInfo() values
might be a good way of testing stuff for SLING-475.
> ...Can I replace a selector.html with replace.html using replaceSelectors ( I
> tried to use it but the result of the replace.jsp is not appearing)....
See above.
> ...Is there a combination for using the above options...
You can pretty much combine all of them, except path and resource
which are mutually exclusive.
Hope this helps - and make sure you have a look at
jsp-taglib/src/main/resources/META-INF/taglib.tld which describes all
those attributes.
-Bertrand