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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:39:37+00:00 2026-06-08T07:39:37+00:00

I have problem using jstl tag <c:if> in jsp file. Basically I should make

  • 0

I have problem using jstl tag <c:if> in jsp file. Basically I should make this as 2 questions although they are related.

The first question:

In my WEB-INF/lib, I put a jstl 1.2.jar

In my jsp file, I put this <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>.

In my jsp file, I use the <c:if> to do something. If the condition is true, it will shows some special message

Basically the contents inside <c:if> is not working, because the message is not shown even the condition is true.

But if I changed to use the older namespace, <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>. Others are not changed, then the if tag is working, because the message inside the if tag is shown.

My first question is why I have to use /jstl instead of /jsp/jstl in namespace. I am using jstl1.2.jar. so I am supposed to use the newer uri for 1.2. however, older uri works but not newer uir.

The second question:

I ignore the first question I have, and just use /jstl as my namespace just because it makes my web app work the way I want. However, when I deploy my web app into tomcat 7.X, it shows exceptions as the following:

org.apache.jasper.JasperException: /mywebapp.jsp (line: 35, column: 10)
According to TLD or attribute directive in tag file, attribute test
does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)

in /mywebapp.jsp line:35, column:10, that is < c:if> tag.

If I change the namespace from <%@ taglib prefix=”c” uri=”http://java.sun.com/jstl/core”%> to <%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core”%>, it can deploy in tomcat successfully but the functionality inside of < c:if> tag is not useful. other codes outside of <c:if> tag work though.

So I am very confused and really want to know how to fix this.

By the way, I am using servlet 2.5, jsp 2.0, jstl 1.2. I did try to upgrade the jsp2.0 to jsp2.1 in order to see if I can fix the first problem, but I have no idea how to upgrade jsp version.

  • 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-08T07:39:38+00:00Added an answer on June 8, 2026 at 7:39 am

    But if I changed to use the older namespace, <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>. others are not changed, then the if tag is working, because the message inside the if tag is shown.

    That can happen if you have a standard.jar of JSTL 1.0 in the /WEB-INF/lib. Get rid of it. See also our JSTL wiki page. I by the way assume that you’ve untouched Tomcat’s and JRE’s own /lib folders and have not dropped any JSTL-related JARs in there, or have extracted the JSTL JAR’s contents in a careless attempt to solve the problem.


    By the way, I am using servlet 2.5, jsp 2.0, jstl 1.2. I did try to upgrade the jsp2.0 to jsp2.1 in order to see if I can fix the first problem, but I have no idea how to upgrade jsp version. I am very new to programming.

    You should absolutely not provide any Servlet or JSP libraries in /WEB-INF/lib yourself. The servlet container (in your case, Tomcat) already ships with it. See also How do I import the javax.servlet API in my Eclipse project?

    You only need to make sure that your web.xml root declaration complies whatever your servlet container supports. Tomcat 7 is a Servlet 3.0 compatible container, so your web.xml root declaration should look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app 
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
        version="3.0">
    
        <!-- Config here. -->
    
    </web-app>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problem with using jstl. I have this: <jsp:useBean id=view class=user.View></jsp:useBean> <jsp:useBean
i have a problem using the Catch Clipboard Events code found on this link
I have problem with using dequeueReusableCellWithIdentifier method. Whenever I use this one, one cell
I have a problem using first-child I have the following html code to make
I have a problem while returning jsp from controller using ajax+spring mvc. I want
i have a problem using css3 transitions how can i make the transition smooth
I have a problem using a small div that should hover over pics that
i have a problem using AS3 - Flash CS3 gives me this Error message:
I am trying to generate a csv file using a jsp file this its
I have problem using arabic font for iOS. All fonts have the same render,

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.