What to do if the prefix c is not bound in JSP

--Environment - Windows10 - Apache Tomcat 8.5.47 - Eclipse Version: Oxygen.3a Release (4.7.3a) - Java version 1.8.0_231

Event: An error occurred in the log file during processing using the JSP file.

Caused by: org.xml.sax.SAXParseException:element"c:choose"Prefix"c"Is not bound.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
...

Cause: The JSTL Core library is not defined in the JSP file.

<%@ page language="java" contentType="text/xml; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<c:choose>
  <c:when test="${Condition 1}" >
    ...Process 1...
  </c:when>
  <c:when test="${Condition 2}" >
    ...Process 2...
  </c:when>
</c:choose>

Action 1: Define the prefix c in the JSP file

<%@ page language="java" contentType="text/xml; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
...abridgement..

What to do if "The tag library descriptor for" http://java.sun.com/jsp/jstl/core "cannot be found"

--Reference -Use of JSTL core tag library --Qiita -Java JSTL custom tag introduction and usage example sample (core, i18n) | ITSakura

If you define the prefix c in the JSP file and a compile error occurs, place the jar file because there is no core tag library in the first place.

  1. Download the jar suitable for your environment from Apache Tomcat site. --Since this version is 1.2.5, download the following jar - taglibs-standard-impl-1.2.5.jar - taglibs-standard-spec-1.2.5.jar - taglibs-standard-jstlel-1.2.5.jar
  2. Place the jar file in the WEB-INF / lib folder

Recommended Posts

What to do if the prefix c is not bound in JSP
[Ubuntu 20.04] What to do if the external monitor is not recognized
[Rails] What to do if data is not registered in DB
What to do if Cloud9 is full in the Rails tutorial
What to do if the background image is not applied after deployment
[Note] What to do if bundle install in Chapter 3 of the rails tutorial is not possible
What to do if the changes are not reflected in the jar manifest file
[Swift] What to do if the app icon is set but not reflected
What to do if Operation not permitted is displayed when you execute a command in the terminal
What to do if audio is not available on discordrb
What to do if FacesMessage is set but not displayed
What to do if the breakpoint is shaded and does not stop during debugging
What to do when the changes in the Servlet are not reflected
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
What to do if the Eclipse Maven dependency Jar is wrong
What to do if you forget the root password in CentOS7
What to do if the server tomcat dies
[Maven] What to do if you are asked to incorporate a jar that is not in the remote repository into the war
What to do if tomcat process remains when tomcat is stopped in eclipse
What to do if the app is not created with the latest Rails version installed when rails new
What to do when rails db: seed does not reflect in the database
Androd: What to do about "The Realm is already in a write transaction in"
What to do if the debug gem installation fails
What to do if the Rails server can't start
What to do if password authentication fails in Docker/Postgres
What to do if the update does not take effect after deploying Rails AWS
What to do if you can't get the text of an element in Selenium
What to do when "Fail to load the JNI shared library" is displayed in Eclipse
What to do if the JSONHint annotation does not work with lombok and JSONIC
What to do if you get a java.io.IOException in GlassFish
What to do when Method not found in f: ajax
What to do if the adb command cannot be executed
What to do if you can't use the rails command
What to do if you don't see the test code error message in the terminal console
[Rails] What to do if you accidentally install bundle in the production environment in your local environment
What to do if you installed Ruby with rbenv but the version does not change
What to do when Rails on Docker does not reflect controller changes in the browser
What to do if you select a JRE in Eclipse and get "The selected JRE does not support the current compliance level 11"
What to do if you get a gcc error in Docker
What to do if validation doesn't work with the update action
What to do if you get a DISPLAY error in gym.render ()
[Logback] What to do if unnecessary files do not disappear during rotation
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
What to do when "relation" hibernate_sequence "does not exist" in the ID column of PostgreSQL + JPA
What to do when you want to know the source position where the method is defined in binding.pry
What to do about the "cannot be read or is not a valid ZIP file" error
What to do when javax.el.ELException: Not a Valid Method Expression: appears when the JSF screen is displayed
What to do if Could not find hoge in any of the sources Run `bundle install` to install missing gems. Appears in the docker container
What is the main method in Java?
What to do if you install Ubuntu
[IOS] What to do when the image is filled with one color
What to do if changes are not reflected after automatic deployment to EC2
What to do if you get a groovy warning in Thymeleaf Layout
What to do if you can't install the plugin from the Eclipse marketplace
What to do if deployment fails on Heroku (Ruby app not detected)
What to do if you don't like the code generated by swagger-codegen-cli
What is CHECKSTYLE: OFF found in the Java source? Checkstyle to know from
What to do if the image posted by refile disappears after setting a 404 error page in Rails
What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial
[Rails / Docker] What to do if access is denied by the browser (localhost: 3000) after adding a gem
[Gradle] [checkstyle] What to do if the active setting of Checkstyle is removed by "Refresh Gradle project" from Eclipse