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 552627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:31:11+00:00 2026-05-13T11:31:11+00:00

The c:if test always fails for me and it never gets inside the loop.

  • 0

The c:if test always fails for me and it never gets inside the loop. I am using the following namespaces

xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:c="http://java.sun.com/jstl/core"

The string (‘array’) to be split is “Tom and Jerry are GAP1 friends”

<s:decorate template="/layout/display-text.xhtml">
    <c:set var="array" value="#{_mybean.value}"/>
    <c:set var="space" value="#{fn:split(array, ' ')}"/>
    <c:set var="len" value="#{fn:length(space)}"/>
    <h:outputText value="total length = #{len}"/><br/>
    <c:forEach begin="0" end="5" var="index">
        <h:outputText value="index = #{index}, value = #{space[index]}"/><br/>
        <c:set var="val" value="#{space[index]}"/>
        <c:if test="#{fn:startsWith(val, 'GAP')}">
            <h:outputText value="Found keyword parameter GAP" /><br/>
        </c:if>
    </c:forEach>
</s:decorate>
  • 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-13T11:31:12+00:00Added an answer on May 13, 2026 at 11:31 am

    The JSTL core URI is invalid. As per the JSTL TLD it should be (note the extra /jsp):

    xmlns:c="http://java.sun.com/jsp/jstl/core"
    

    That said, mixing JSF with JSTL is never been a good idea. It won’t always give results as you’d expect because they doesn’t run in sync as you would expect from the coding. It’s more that JSP/JSTL runs from top to bottom first and then hands over the produced result to JSF to process further from top to bottom again. That would cause some specific constructs to fail. Better use pure JSF components/attributes instead.

    Instead of c:forEach, rather use Seam’s a4j:repeat or Facelets’ ui:repeat and instead of c:if make use of the rendered attribute of the JSF component which has to be toggled to show/hide. Instead of all that JSTL c:set, write appropriate code logic in managed bean constructor or action method or getter.

    The JSTL functions (fn) taglib is however still highly valuable in JSF. You can keep using it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 344k
  • Answers 344k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I thing the connection URL may be wrong. Then try… May 14, 2026 at 5:37 am
  • Editorial Team
    Editorial Team added an answer This ended up being the answer. I need to change… May 14, 2026 at 5:37 am
  • Editorial Team
    Editorial Team added an answer It does, System.Runtime.InteropServices.ComTypes.IStream. A sample wrapper: using System; using iop… May 14, 2026 at 5:37 am

Related Questions

I just started using Boost::regex today and am quite a novice in Regular Expressions
PROBLEM: Ok, I've been TRYING to follow the sample code on the MySQL Forge
A puzzle that hit me. In some simple test harness code, if I stream
Working with the fine mocking-framework MoQ, I came across a somewhat surprising facet (and
I am in the process of setting up a complete web-development environment. For now,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.