views:

31

answers:

1

I have plain HTML file and I want to include some JSTL tags in that, first I am trying whether this works. But somehow JSTL tags are now showing value after rendering. Here is the code:

<html 
xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org/"
xmlns:c="http://java.sun.com/jstl/core"&gt;
      <body>
       <c:set var="test" value="success" />
       <c:out value="${test}"/>
      </body>
</html>

And my web.xml has:

<web-app
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="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="WebApp_ID" version="2.5">

I have also added jstl-1.2.jar to my web-inf/lib folder.

Problem is I am not seeing anything on my html page. I am expecting to see "success". Any suggestions?

+1  A: 

Is the type .jsp? If not, how did you expect the JSP engine to know that this had to be compiled into a servlet?

You also have to include the JSTL taglibs, right?

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>

Can't be a plain HTML file and expect it to work as a JSP.

duffymo
No it is of type .html. The reason is I am using wicket framework for that page should be of type html. Is there any way I can use JSTL tags in html file?
goutham
I don't see how the JSP engine can know that it needs to compile a .html file into a servlet.
duffymo
Looks like you need to be using Wicket tag libraries: http://www.javalobby.org/java/forums/t60786.html
duffymo