Note that there are some explanatory texts on larger screens.

plurals
  1. POJSTL is not evaluated with embedded Jetty and the jetty-console-maven-plugin
    primarykey
    data
    text
    <p>Long story short: I get this as output</p> <pre class="lang-html prettyprint-override"><code>&lt;html&gt;&lt;body&gt;&lt;c:if test="false"&gt; strange &lt;/c:if&gt;&lt;/body&gt;&lt;/html&gt; </code></pre> <p>when using JSTL with an embedded Jetty. </p> <p>Long story long:</p> <p>my directory structure:</p> <pre><code>web-example+ |_src+ | \_main+ | \_webapp+ | |_index.jspx | |_WEB-INF+ | \_web.xml \_pom.xml </code></pre> <p>my web.xml:</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebExample" version="2.5"&gt; &lt;/web-app&gt; </code></pre> <p>my index.jspx:</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:parts="urn:jsptagdir:/WEB-INF/tags"&gt; &lt;jsp:directive.page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" /&gt; &lt;html&gt;&lt;body&gt; &lt;c:if test="${'1' == true}"&gt; strange &lt;/c:if&gt; &lt;/body&gt;&lt;/html&gt; &lt;/jsp:root&gt; </code></pre> <p>and, finally, my pom.xml:</p> <pre class="lang-xml prettyprint-override"><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.example&lt;/groupId&gt; &lt;artifactId&gt;web-example&lt;/artifactId&gt; &lt;packaging&gt;war&lt;/packaging&gt; &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;version&gt;2.3.2&lt;/version&gt; &lt;configuration&gt; &lt;source&gt;1.6&lt;/source&gt; &lt;target&gt;1.6&lt;/target&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.simplericity.jettyconsole&lt;/groupId&gt; &lt;artifactId&gt;jetty-console-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.47&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;goals&gt; &lt;goal&gt;createconsole&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt; &lt;artifactId&gt;jetty-http&lt;/artifactId&gt; &lt;version&gt;8.1.4.v20120524&lt;/version&gt; &lt;type&gt;jar&lt;/type&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt; &lt;artifactId&gt;jetty-server&lt;/artifactId&gt; &lt;version&gt;8.1.4.v20120524&lt;/version&gt; &lt;type&gt;jar&lt;/type&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt; &lt;artifactId&gt;jetty-jsp&lt;/artifactId&gt; &lt;version&gt;8.1.4.v20120524&lt;/version&gt; &lt;type&gt;jar&lt;/type&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt; &lt;artifactId&gt;jetty-servlet&lt;/artifactId&gt; &lt;version&gt;8.1.4.v20120524&lt;/version&gt; &lt;type&gt;jar&lt;/type&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt; &lt;artifactId&gt;jetty-webapp&lt;/artifactId&gt; &lt;version&gt;8.1.4.v20120524&lt;/version&gt; &lt;type&gt;jar&lt;/type&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; </code></pre> <p>I assume that this is a problem specific to the jetty-console-maven-plugin, since everything works fine when I start the webapp within Eclipse (using a small Java class that starts Jetty I did not include here).</p> <p>I have looked at other answers, e.g., from <a href="https://stackoverflow.com/questions/2151075/cannot-load-jstl-taglib-within-embedded-jetty-server">cannot load JSTL taglib within embedded Jetty server</a> and <a href="https://stackoverflow.com/questions/11519161/jstl-not-parsed-in-a-jsp-page-running-on-an-embedded-jetty-instance">JSTL not parsed in a JSP page running on an embedded Jetty instance</a> and thereby changed quite some things which helped me to get so far, e.g., I updated the jetty-console-maven-plugin in order to not have old servlet specification code, I removed jsp and servlet JARs from /usr/share/java, I updated the XML specs of the web.xml and index.jspx, and so on but it did not help. </p> <p>Does anybody have an idea what is going wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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