jsp - <c:out value="Test"/> inside jspx doesn't show in browser -
when try test jstl lib (jstl-1.1.2.jar & standard-1.1.2.jar) adding doesn't show in browser.
this home.jspx:
<?xml version="1.0" encoding="utf-8"?> <jsp:root xmlns:jsp="http://java.sun.com/jsp/page" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns="http://www.w3.org/1999/xhtml" version="2.1"> <jsp:directive.page contenttype="text/html" pageencoding="utf-8" /> <jsp:output omit-xml-declaration="true" /> <jsp:output doctype-root-element="html" doctype-system="about:legacy-compat" /> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>gdgdfgdg</title> </head> <body> <h1>fsdf</h1> <c:out value="test"/> </body> </html> </jsp:root> necessary jars added. can't figure out what's problem.
edited:
this source code, browser receives:
<!doctype html system "about:legacy-compat"> <html lang="en"> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type"/> <title>gdgdfgdg</title> </head> <body> <h1>fsdf</h1> <c:out value="test"/> </body> </html> i added following dependencies maven , loaded right jars described @ top properly..
<dependency> <groupid>jstl</groupid> <artifactid>jstl</artifactid> <version>1.1.2</version> </dependency> <dependency> <groupid>taglibs</groupid> <artifactid>standard</artifactid> <version>1.1.2</version> </dependency>
the provided jspx works fine in environment, tomcat 6.0 , following:
<dependency> <groupid>javax.servlet.jsp.jstl</groupid> <artifactid>jstl-api</artifactid> <version>1.2</version> </dependency> <dependency> <groupid>org.glassfish.web</groupid> <artifactid>jstl-impl</artifactid> <version>1.2</version> </dependency> <dependency> <groupid>javax.el</groupid> <artifactid>el-api</artifactid> <version>2.2</version> <scope>provided</scope> </dependency> <dependency> <groupid>javax.servlet.jsp</groupid> <artifactid>jsp-api</artifactid> <version>2.1</version> <scope>provided</scope> </dependency> according apache, 1.1.2 taglibs should work on tomcat 5.0 or later, since included jsp version 2.1 in head of jspx, need run on servlet spec 2.5 or later server, such tomcat 6.
your best bet use dependencies i've provided , make sure servlet container recent.
Comments
Post a Comment