Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6586133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:45:05+00:00 2026-05-25T16:45:05+00:00

Consider the following jstl choose: <c:choose> <c:when test=#{AuthMsgBean.rw[‘2’] ne null}> Display Text </c:when> <c:otherwise>

  • 0

Consider the following jstl choose:

<c:choose>
    <c:when test="#{AuthMsgBean.rw['2'] ne null}">
        Display Text
    </c:when>

    <c:otherwise>
        <ph:outputText id="pan" value="Component pan could not be created." />
    </c:otherwise>
</c:choose>

AuthMsgBean = Bean

rw = Map

‘2’ = Key


Question:

When I simply display the #{AuthMsgBean.rw['2'] ne null} value it displays fine (true), but once I try to parse the value to the <c:when test=""/> the when tag re-acts as if the test is always false.

If I put true in the test (test="true") the Display Text is displayed.

Could it be that the <c:when> tag is evaluated before the #{AuthMsgBean.rw['2'] ne null} expression?

If so, is there a workaround?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:45:06+00:00Added an answer on May 25, 2026 at 4:45 pm

    JSTL and JSF do not run in sync as you’d expect from coding. During JSF view build time, it’s JSTL which runs from top to bottom first to produce a view with only JSF tags. During JSF view render time, it’s JSF which runs from top to bottom again to produce a bunch of HTML.

    Apparently the #{AuthMsgBean} is not present in the scope when it’s JSTL’s turn to run. That can happen when the tags are placed inside a JSF iterating component such as <h:dataTable>.

    Regardless, you do not want to use JSTL here. Make use of the JSF rendered attribtue.

    <h:panelGroup rendered="#{not empty AuthMsgBean.rw['2']}">
        Display Text
    </h:panelGroup>
    <h:outputText id="pan" value="Component pan could not be created." rendered="#{empty AuthMsgBean.rw['2']}" />
    

    See also:

    • Conditionally displaying JSF components
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider following class class test { public: test(int x){ cout<< test \n; } };
Consider the following ruby code test.rb: begin puts thisFunctionDoesNotExist x = 1+1 rescue Exception
Consider following tables in MySQL database: entries: creator_id INT entry TEXT is_expired BOOL other:
Please consider following schema CREATE table articles ( id Int UNSIGNED NOT NULL AUTO_INCREMENT,
Consider following: Partial View: <%= Html.ListBox(BlackList, Model.Select( x => new SelectListItem { Text =
Let's consider following html code: <p> Some text followed by <span>a span element</span> and
Please consider following sample table structure: +-------------------------------+--------------+------+-----+---------+-------+ | Field | Type | Null |
Consider following table. I'm trying to write a query to display - Max values
Consider following text file: something something something = someother thing other thing = third
Consider following two examples: Example 1: <xs:import namespace=http://example.com/ns schemaLocation=test.xsd/> Example2: <sample:Data Test=true xsi:schemaLocation=http://example.com/test.xsd> How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.