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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:22:58+00:00 2026-06-12T09:22:58+00:00

I am pretty new with JSTL, so need your help with something. I have

  • 0

I am pretty new with JSTL, so need your help with something.

I have a string named “specialties”, in which I’m checking if a particular string exists, and if it does, I check mark the input corresponding to it, and then replacing it with empty string.

<input type="checkbox" name="specialities" value="OB/Gyn" 
<c:if test="${fn:containsIgnoreCase(asc_details.specialities, 'OB/Gyn')}">
<c:set var="specialities" value="${fn:replace(specialities,'OB/Gyn','')}"></c:set>
<c:out value="${'checked'}"/></c:if>
/>&nbsp;OB/Gyn

<input type="checkbox" name="specialities" value="Plastic/reconstructive"
<c:if test="${fn:containsIgnoreCase(specialities, 'Plastic/reconstructive')}">
<c:set var="specialities" value="${fn:replace(specialities,'Plastic/reconstructive','')}"></c:set>
<c:out value="${'checked'}"/></c:if>
/>&nbsp;Plastic/reconstructive

It works great for the first matching string “OB/Gyn” and replaces it with empty string, but it doesn’t replace “Plastic/reconstructive” with empty string. I’m not able to figure out why that is happening. Please help.

  • 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-06-12T09:22:59+00:00Added an answer on June 12, 2026 at 9:22 am

    There’s a possible case sensitivity bug here. The containsIgnoreCase() test is case insensitive, so it would pass for example “plastic”, “Plastic”, “PlAsTiC” and “PLASTIC”, however the replace() is case sensitive and it would replace only “Plastic”.

    That it failed for you most likely means that the value didn’t exactly match the case. Perhaps it’s actually “Plastic/Reconstructive” or so?

    You’d basically need to fix the casing (and replace the containsIgnoreCase() by contains()), or to perform a case insensitive replacement, however such a function is not available in JSTL. You’d most likely need to homegrow one.

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

Sidebar

Related Questions

Am pretty new to ROR. Need help in Rails form validation. Am using rails
pretty new to using Qt. I have a custom widget that i need to
Pretty new to MVC and the like. I have a class the looks like
I pretty new to Objective-C (and C itself) and need to consume a NSData
I am pretty new to buddypress. I am trying to do something pretty simple
Pretty new to the Magento e-commerce solution. Have it up and running for a
still pretty new to android I have to clone an iphone application. Im having
Pretty new to ASP.NET and trying to figure out how to have the code
Pretty new to threading and I have this QList that the threads share between
Im pretty new to Dreamweaver. Im having a problem. I have a website that

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.