JSTL tags shown in browser
I have a Mavenized Spring MVC project that deploys locally or remotely (passing all tests) using the jetty plugin.
However when I try to deploy the war file to a tomcat 6 server, I see the jstl tags in the source. The JSTL jar is in the lib folder, and no errors are shown on startup.
SO if I visit http://myserver:8081/ I see the landing page, but elements that should use the jstl core tags just dump the raw source.
Example
<html xmlns:c="http://java.sun.com/jsp/jstl/core"><c:url value="resources" var="resources_url"/><c:url value="/" var="home_url"/><head>
<c:choose><c:when test="true"><ul><c:forEach varStatus="x" var="entry" items="[SyndEntryImpl.contributors=[]
SyndEntryImpl.contents=[]
SyndEntryImpl.updatedDate=Wed Jul 27 13:24:29 EDT 2011
SyndEntryImpl.link=http://myserver/2011/07/27/Capability+Management+-+Community+Style
SyndEntryImpl.foreignMarkup=[]
SyndEntryImpl.links[0].hreflang=null
Included jars:
webapps/ROOT/WEB-INF/lib/
|-- antlr-2.7.6.jar
|-- aopalliance-1.0.jar
|-- asm-3.1.jar
|-- aspectjlib-1.6.2.jar
|-- aspectjrt-1.6.7.jar
|-- aspectjweaver-1.6.7.jar
|-- cglib-2.2.jar
|-- common-2.1.0.jar
|-- commons-beanutils-1.8.0.jar
|-- commons-codec-1.4.jar
|-- commons-collections-3.1.jar
|-- commons-digester-1.8.1.jar
|-- commons-io-1.2.jar
|-- commons-lang-2.4.jar
|-- common开发者_如何学Gos-logging-1.0.4.jar
|-- dom4j-1.6.1.jar
|-- ecore-2.1.0.jar
|-- ehcache-core-2.1.1.jar
|-- emf-2.1.0.jar
|-- events-1.0.jar
|-- health-2.0-BETA-6.jar
|-- hibernate-annotations-3.5.6-Final.jar
|-- hibernate-commons-annotations-3.2.0.Final.jar
|-- hibernate-core-3.5.6-Final.jar
|-- hibernate-entitymanager-3.5.6-Final.jar
|-- hibernate-jpa-2.0-api-1.0.0.Final.jar
|-- hibernate-validator-4.1.0.Final.jar
|-- jackson-core-asl-1.6.4.jar
|-- jackson-mapper-asl-1.6.4.jar
|-- javassist-3.9.0.GA.jar
|-- jdom-1.0.jar
|-- joda-time-1.6.jar
|-- jsr250-api-1.0.jar
|-- jstl-1.1.2.jar
|-- jta-1.1.jar
|-- log4j-1.2.14.jar
|-- logging-1.1.jar
|-- mysql-connector-java-5.1.8.jar
|-- rome-1.0.0.jar
|-- slf4j-api-1.5.11.jar
|-- slf4j-log4j12-1.4.3.jar
|-- spring-aop-3.0.5.RELEASE.jar
|-- spring-asm-3.0.5.RELEASE.jar
|-- spring-beans-3.0.5.RELEASE.jar
|-- spring-context-3.0.5.RELEASE.jar
|-- spring-context-support-3.0.5.RELEASE.jar
|-- spring-core-3.0.5.RELEASE.jar
|-- spring-expression-3.0.5.RELEASE.jar
|-- spring-jdbc-3.0.5.RELEASE.jar
|-- spring-jms-3.0.5.RELEASE.jar
|-- spring-orm-3.0.5.RELEASE.jar
|-- spring-tx-3.0.5.RELEASE.jar
|-- spring-web-3.0.5.RELEASE.jar
|-- spring-webmvc-3.0.5.RELEASE.jar
|-- tiles-api-2.1.4.jar
|-- tiles-core-2.1.4.jar
|-- tiles-jsp-2.1.4.jar
|-- tiles-servlet-2.1.4.jar
|-- urlrewritefilter-3.1.0.jar
|-- validation-api-1.0.0.GA.jar
`-- xml-apis-1.0.b2.jar
I'm sure that is not enough to help, but just let me know what files/logs can help and I will append them.
Well, this is pretty silly, but although the JSTL and tiles jars are included, the core TagLib jar was not. This was in Maven as a "provided" dependency.
That explains why it was being included in the Jetty plugin, but left out of my final war file. Changing that to compile scope and everything is working fine.
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<scope>compile</scope>
</dependency>
精彩评论