Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're using JSF on JSP, then you can do it just the same way as you would do in "plain JSP EL". </p> <pre><code>#{pageContext.request} </code></pre> <p>If you're using JSF on Facelets, then you can omit the <code>pageContext</code> part from the way as you would do in "plain JSP EL".</p> <pre><code>#{request} </code></pre> <p>Either way, it returns the <a href="http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html" rel="nofollow noreferrer"><code>HttpServletRequest</code></a> object.</p> <p>However, the only method which determines the user role is the <a href="http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#isUserInRole%28java.lang.String%29" rel="nofollow noreferrer"><code>isUserInRole(String role)</code></a> method. You can't pass arguments to methods in standard EL. You can however do that when you replace standard EL by JBoss EL. </p> <pre><code>#{request.isUserInRole(role)} </code></pre> <p>To install JBoss EL, just put <a href="https://maven.atlassian.com/content/repositories/jboss-releases/org/jboss/seam/jboss-el/2.0.0.GA/jboss-el-2.0.0.GA.jar" rel="nofollow noreferrer">jboss-el.jar</a> in <code>/WEB-INF/lib</code> and add the following to the <code>web.xml</code>, assuming that you're using Mojarra:</p> <pre><code>&lt;context-param&gt; &lt;param-name&gt;com.sun.faces.expressionFactory&lt;/param-name&gt; &lt;param-value&gt;org.jboss.el.ExpressionFactoryImpl&lt;/param-value&gt; &lt;/context-param&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload