Trying to use JSTL but have the following problem:
Index.xhtml page:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:jsp="http://java.sun.com/JSP/Page">
<body>
<c:out value="Hello world!"/>
</body></html>
POM:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
OUTPUT SOURCE:
<html id="document:html" lang="en" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:jsp="http://java.sun.com/JSP/Page"><head><meta content="Rendered by ICEFaces D2D" name="icefaces" />
.....
<c:out value="Hello world!"></c:out>
....</body></html>
As you can see its not processing the c:out but just printing it out as text.
JSTL stands for JSP Standard Tag Library. JSTL is the standard tag library that provides tags to control the JSP page behavior. JSTL tags can be used for iteration and control statements, internationalization, SQL etc.
No. It is not possible to have JSTL in HTML page.
The initial JSTL 1.0 EL lacked support for functions. The JSP 2.0 EL lets you call a Java class's public static method using the following syntax: ${prefix:methodName(param1, param2, ...)} The Java class doesn't have to implement any special interface.
JSTL, which stands for JavaServer Pages Standard Tag Library, is a collection of custom JSP tag libraries that provide common Web development functionality.
Seems that:
The solution is to remove the /jsp from the jstl namespace:
xmlns:c="http://java.sun.com/jstl/core"
See this post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With