Jahia Dev Forum > Issues with Jahia...

0 (0 Good)
0 (0 Bad)

Issues with Jahia JSP Taglib / EL (Version 6.6.0.0)

by  namitgupta »  2012/10/20 12:13

 

Hi All,

 

We have a requirement for implementing an access control a specific module. This module is added to the home template in our template set.  I have been trying out group based access control for the users. Here are the steps which have been tried out:

 

Access Control Using OOB taglibs

 

1)      I have tried to access the group membership of the current user using the following expression:

 

${renderContext.user.memberOfGroup(${renderContext.site.ID},'EEBusiness')}

 

This expression should return a boolean value(Referencehttp://www.jahia.com/downloads/jahia/jahia6.6.0/jahia-root-6.6.0.0-aggregate-javadoc/org/jahia/services/render/RenderContext.html).

 

2)      The above mentioned JSP expression throws a Parse Exception at runtime. 

 

3)      This issue occurred because the OOB Appserver (Tomcat 6.0.35) supports JSP 2.1 standard , which doesn’t allow accessing a member function of an instance object in EL (Referencehttp://www.coderanch.com/t/561632/JSP/java/it-possible-access-instance-methods). In our case, we are using ‘memberOfGroup’ member function. This functionality is available in JSP 2.2 standard which comes inbuilt with Apache Tomcat 7.x.

 

 

4)      However, as per Apache’s online documentation, JSP 2.2 standard can be integrated with the Tomcat 6.0.x by adding new libraries to it and declaring the same in the context path in web.xml (Referencehttp://wiki.apache.org/myfaces/HowToEnableEl22).

 

5)      I tried integration EL2.2 with tomcat as per the steps mentioned (Ref1http://www.javaplex.com/blog/for-jsf-2-how-to-enable-el-2-2-on-tomcat-6/ Ref2http://wiki.apache.org/myfaces/HowToEnableEl22). PFA libraries used in integration. Also, I added the following configuration to the web.xml located in C:\jahia\tomcat\webapps\ROOT\WEB-INF. However, I’m still facing the same issue.

 

Please share your thoughts on this.

 

Regards,

Namit

 
  • Issues with Jahia JSP Taglib / EL (Version 6.6.0.0)
    2012/10/20 12:13

    namitgupta <p> &nbsp;</p> <p> Hi All,</p> <p> &nbsp;</p> <p> We have a requirement for implementing an access control a specific module. This module is added to the home template in our template set. &nbsp;I have been trying out group based access control for the users. Here are the steps which have been tried out:</p> <p> &nbsp;</p> <p> <strong>Access Control Using OOB taglibs</strong></p> <p> &nbsp;</p> <p> 1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I have tried to access the group membership of the current user using the following expression:</p> <p style="margin-left: 0.5in; "> &nbsp;</p> <p style="margin-left: 0.5in; "> <strong>${renderContext.user.memberOfGroup(${renderContext.site.ID},&#39;EEBusiness&#39;)}</strong></p> <p style="margin-left: 0.5in; "> &nbsp;</p> <p style="margin-left: 0.5in; "> This expression should return a boolean value(<strong>Reference</strong>:&nbsp;<a href="http://www.jahia.com/downloads/jahia/jahia6.6.0/jahia-root-6.6.0.0-aggregate-javadoc/org/jahia/services/render/RenderContext.html">http://www.jahia.com/downloads/jahia/jahia6.6.0/jahia-root-6.6.0.0-aggregate-javadoc/org/jahia/services/render/RenderContext.html).</a></p> <p> &nbsp;</p> <p> 2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The above mentioned JSP expression throws a Parse Exception at runtime.&nbsp;</p> <p> &nbsp;</p> <p> 3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This issue occurred because the OOB Appserver (<strong>Tomcat 6.0.35</strong>) supports JSP 2.1 standard , which doesn&rsquo;t allow accessing a member function of an instance object in EL (<strong>Reference</strong>:&nbsp;<a href="http://www.coderanch.com/t/561632/JSP/java/it-possible-access-instance-methods">http://www.coderanch.com/t/561632/JSP/java/it-possible-access-instance-methods</a>). In our case, we are using &lsquo;<strong>memberOfGroup</strong>&rsquo; member function. This functionality is available in JSP 2.2 standard which comes inbuilt with Apache Tomcat 7.x.</p> <p> &nbsp;</p> <p> &nbsp;</p> <p> 4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; However, as per Apache&rsquo;s online documentation, JSP 2.2 standard can be integrated with the Tomcat 6.0.x by adding new libraries to it and declaring the same in the context path in web.xml (<strong>Reference</strong>:&nbsp;<a href="http://wiki.apache.org/myfaces/HowToEnableEl22">http://wiki.apache.org/myfaces/HowToEnableEl22</a>).</p> <p> &nbsp;</p> <p> 5)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I tried integration EL2.2 with tomcat as per the steps mentioned (<strong>Ref1</strong>:&nbsp;<a href="http://www.javaplex.com/blog/for-jsf-2-how-to-enable-el-2-2-on-tomcat-6/">http://www.javaplex.com/blog/for-jsf-2-how-to-enable-el-2-2-on-tomcat-6/</a>&nbsp;<strong>Ref2</strong>:&nbsp;<a href="http://wiki.apache.org/myfaces/HowToEnableEl22">http://wiki.apache.org/myfaces/HowToEnableEl22</a>). PFA libraries used in integration. Also, I added the following configuration to the&nbsp;<strong>web.xml&nbsp;</strong>located in&nbsp;<strong>C:\jahia\tomcat\webapps\ROOT\WEB-INF</strong>. However, I&rsquo;m still facing the same issue.</p> <p> &nbsp;</p> <p> Please share your thoughts on this.</p> <p> &nbsp;</p> <p> Regards,</p> <p> Namit</p> <div> &nbsp;</div>

  • Number of messages  36
    Registration date Oct 20, 2012
    0 (0 Good)
    0 (0 Bad)

    Re: Issues with Jahia JSP Taglib / EL (Version 6.6.0.0)

    by  shyrkov »  2012/10/22 21:31

    Hello Namit,

    I've have an answer to your question in the Jahia in English section post.

     

    Kind regards

    Sergiy

    Sergiy Shyrkov (shyrkov)

    Number of messages  407
    Registration date
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page