Can we get current page URL since slingRequestObject is not available in the class? for example i can get SlingRepository, ResourceResolverFactory and SlingSettingsService object by referencing and maven build generates serviceComponent.xml as complete OSGI bundle.
Thanks Chandra
Solved! Go to Solution.
Views
Replies
Total Likes
http://dev.day.com/docs/en/cq/current/javadoc/org/apache/sling/rewriter/DefaultTransformer.html
DefaultTransformer init method provides Slign Request.
private class StringTransformer extends DefaultTransformer {
public void init(ProcessingContext context,
ProcessingComponentConfiguration config) throws java.io.IOException {
StringReWriterImpl.this.request = context.getRequest();
LOG.info("INIT is called -------------- ************** -------"+context.getRequest().getResource().getPath());
}
}
http://dev.day.com/docs/en/cq/current/javadoc/org/apache/sling/rewriter/DefaultTransformer.html
DefaultTransformer init method provides Slign Request.
private class StringTransformer extends DefaultTransformer {
public void init(ProcessingContext context,
ProcessingComponentConfiguration config) throws java.io.IOException {
StringReWriterImpl.this.request = context.getRequest();
LOG.info("INIT is called -------------- ************** -------"+context.getRequest().getResource().getPath());
}
}
I am glad that you got this working - we are going to get this subject matter into a community developer article.
Views
Replies
Total Likes
The following stack overflow thread looks like it will help you to get information on a page such as an URL:
http://stackoverflow.com/questions/10502284/get-url-minus-current-filename-in-jsp-or-cq5
How to use org.apache.sling.rewriter within an OSGi bundle is on our list of articles.
I also recommend looking at this topic:
http://sling.apache.org/site/output-rewriting-pipelines-orgapacheslingrewriter.html
Views
Replies
Total Likes
I have updated ... might be useful for others.Thanks for reply by the way
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies