Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try this simple .jsp page if anything works at all. Test page uses random fmt and c features.</p> <pre><code>&lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;&lt;%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %&gt;&lt;%@ page contentType="text/html; charset=UTF-8" pageEncoding="ISO-8859-1" import="java.util.*, java.text.* " %&gt;&lt;% String var0 = "Foodoo0 " + System.currentTimeMillis(); pageContext.setAttribute("var1", "Foodoo1 " + System.currentTimeMillis()); pageContext.setAttribute("var2", "Foodoo2 " + System.currentTimeMillis()); double distance = 1234.567; pageContext.setAttribute("distance", distance); %&gt;&lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Test page&lt;/title&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8" /&gt; &lt;/head&gt; &lt;body&gt; var0=&lt;%= var0 %&gt; &lt;br/&gt; var1=${var1} &lt;br/&gt; &lt;c:out value="COut Foo" /&gt; &lt;br/&gt; var2=&lt;c:out value="${var2}" /&gt; &lt;br/&gt; &lt;br/&gt; Use locale fi_FI&lt;br/&gt; &lt;fmt:setLocale value="fi_FI" scope="page" /&gt; &lt;c:set var="distanceEL" value="${distance}" /&gt; fmt0=${distance} | ${distanceEL} &lt;br/&gt; fmt1=&lt;fmt:formatNumber pattern="0.0" value="${distance}" /&gt; &lt;br/&gt; fmt2=&lt;fmt:formatNumber pattern="0.00" value="${distanceEL}" /&gt; &lt;br/&gt; fmt3=&lt;%= new DecimalFormat("0.0").format(distance) %&gt; &lt;br/&gt; Use locale en_US&lt;br/&gt; &lt;fmt:setLocale value="en_US" scope="page" /&gt; &lt;c:set var="distanceEL" value="${distance+3456.78}" /&gt; fmt0=${distance} | ${distanceEL} &lt;br/&gt; fmt1=&lt;fmt:formatNumber pattern="0.0" value="${distance}" /&gt; &lt;br/&gt; fmt2=&lt;fmt:formatNumber pattern="0.00" value="${distanceEL}" /&gt; &lt;br/&gt; fmt3=&lt;%= new DecimalFormat("0.0").format(distance) %&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I have used these libraries in Tomcat6 server, but they are a bit old. Have not bothered to update cause Tomcat6 itself is a legacy anyway.</p> <ul> <li>lib/jstl-api-1.2.jar </li> <li>lib/jstl-impl-1.2.jar </li> <li>lib/el-api.jar_OLD (renamed old tomcat .jar to disable it)</li> <li>lib/el-api-1.1.jar</li> <li>lib/el-impl-1.1.jar</li> </ul> <p>These are the files I use in Tomcat7 server, Tomcat7 has lib/el-api.jar and lib/jasper-el.jar which are fine. No need to update them.</p> <ul> <li>javax.servlet.jsp.jstl-api-1.2.1.jar</li> <li>javax.servlet.jsp.jstl-1.2.2.jar</li> </ul> <p>Download fresh jars from <a href="http://search.maven.org/#browse|707331597" rel="nofollow">http://search.maven.org/#browse|707331597</a> and <a href="http://search.maven.org/#browse|-1308691387" rel="nofollow">http://search.maven.org/#browse|-1308691387</a> links.</p> <p>Make sure use proper webapp specs version attribute in mywebapp/WEB-INF/web.xml file. This is Tomcat6 webapp.</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app version="2.5" 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_2_5.xsd" &gt; &lt;description&gt;My webapp&lt;/description&gt; &lt;display-name&gt;My webapp&lt;/display-name&gt; &lt;/web-app&gt; </code></pre> <p>This it Tomcat7 webapp.</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt; &lt;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" &gt; &lt;description&gt;My webapp&lt;/description&gt; &lt;display-name&gt;My webapp&lt;/display-name&gt; &lt;/web-app&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload