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

  • Home
  • SEARCH
  • 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 5980127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:45:26+00:00 2026-05-22T21:45:26+00:00

On my current page I am using JSTL to check if data is available

  • 0

On my current page I am using JSTL to check if data is available for my form. Problem I am facing is “if there is no data I am not seeing the text fields either”. I can solve it using and tags but that would entail lot of if else if else kind of code all through the page. Can anyone suggest me a better cleaner solution to this problem?

<c:if test="${salesData!=null}">
  <c:if test="${fn:length(salesBundle.salesArea) > 0}">
  <input type="text" id="sales_area" class="salesManagerStyle">
  </c:if>
</c:if>
  • 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-22T21:45:26+00:00Added an answer on May 22, 2026 at 9:45 pm

    You can have multiple conditions in a test.

    <c:if test="${salesData != null && fn:length(salesBundle.salesArea) > 0}">
        <input type="text" id="sales_area" class="salesManagerStyle">
    </c:if>
    

    But you can also use the empty keyword to do both a nullcheck and lengthcheck.

    <c:if test="${not empty salesData.salesArea}">
        <input type="text" id="sales_area" class="salesManagerStyle">
    </c:if>
    

    That’s the best what you can get, now. If you need to reuse the same condition elsewhere in the page, then you could also save it by <c:set>.

    <c:set var="hasSalesData" value="${not empty salesData.salesArea}" />
    ...
    <c:if test="${hasSalesData}">
        <input type="text" id="sales_area" class="salesManagerStyle">
    </c:if>
    ...
    <c:if test="${hasSalesData}">
        Foo
    </c:if>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to show the current date in my JSP page using JSTL.
Is there any way to identify whether someone has refreshed the current page using
I have a form which is overlayed over the visitors current page using jQuery
Is there any way to know how much memory current web page is using
Any way to submit a form without refreshing the current page at all using
I can set the background color of the current page using: document.body.style.background='red'; Is there
How can I find the current page number in jqGrid (using jQuery of course).
Using Php I would like to extract the current Url of a page including
I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but
I used this code to print the current page: <form> <input type=button value=Print onClick=window.print();

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.