Sitemesh 2/3 with Struts 2

245 views
Skip to first unread message

Christian

unread,
Apr 21, 2011, 5:46:10 AM4/21/11
to sitemes...@googlegroups.com
Hello all,

the current Struts 2.2.1 is shipped with Sitemesh 2. I had some pain to get to the project location and it looks like Sitemesh 2 is not longer developed. But can Sitemesh 3 already easily (!) installed with Struts? I have not too much time to invest much time in a Sitemesh 3 upgrade.

I am even currently unsure if I should upgrade. I just want use the Sitemesh 2 DivExtractingPageParser. But I cannot find any information or examples on usage.

Can you advise? I am glad about instructions on S2 DivExtractingPageParser examples/hints or a S3 upgrade if there is a feature which does something similar.

Thanks
Christian

Ashish Chudasama

unread,
Jun 4, 2013, 12:19:59 PM6/4/13
to sitemes...@googlegroups.com
HI ,

Please add following lines into your sitemesh3.xml file and Div based extraction will work as expected 


<?xml version="1.0" encoding="UTF-8"?>
<sitemesh>
<content-processor>
   <tag-rule-bundle class="org.sitemesh.content.tagrules.html.DivExtractingTagRuleBundle" />
       </content-processor>
   
<mapping path="/*" decorator="/decorators/main.jsp" />
</sitemesh>



on your jsp page use the following code


<sitemesh:write property='div.content_section' />

I hope that this will help you.

if you implemented printable decorator or paramater based decorator in sitemesh 3 please share your code snippet for the same.


Regards,
Ashish Chudasama
Reply all
Reply to author
Forward
0 new messages