tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Reynolds" <James.Reyno...@intermountainmail.org>
Subject RE: How do i use xmlns directive for including a taglib with Tomcat?
Date Thu, 09 Feb 2006 01:25:38 GMT
In short, Tomcat does.

You're missing some elements in that file.  Here's an example jspx file:

<jsp:root version="2.0"
          xmlns:jsp="http://java.sun.com/JSP/Page"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:t="http://myfaces.apache.org/tomahawk"
          xmlns="http://www.w3.org/1999/xhtml">

    <f:view>

        <html>

        <head>
            <jsp:directive.page contentType="text/html"/> NOTE THIS
LINE.  It tricks Internet Explorer into displaying the page properly
(not just xml)

            <title><h:outputText value="#{TestBean.cssPath}"/></title>
            <t:stylesheet path="/resources/#{TestBean.cssPath}"/>
        </head>

        <body>
        <h:form>

            <t:htmlTag value="p">
                <h:outputText value="Fore Score and Seven Years
ago..."/>
            </t:htmlTag>

        </h:form>
        </body>
        </html>
    </f:view>
</jsp:root> 

-----Original Message-----
From: Matthew Giannini [mailto:mgiannini@thunderhead.com] 
Sent: Wednesday, February 08, 2006 4:02 PM
To: users@tomcat.apache.org
Subject: How do i use xmlns directive for including a taglib with
Tomcat?

Hi,

 

I am trying to get this simple JSP page to work using the xmlns method
of including a tag library.  I noticed that all the jsp2 examples with
Tomcat 5.5.x do not use the xmlns method, but they use taglib directives
like : <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

 

However, I would like to do the following so that my JSP page is XML
complient:  This JSP page below simply displays a table with the
headings only.  If I remove the xmlns:c and insert the taglib directive
like above, this will work (i.e. it will display the dynamic content
using the tags correctly).

 

Can somebody please tell me if Tomcat 5.5.x does not support the xmlns
method of using tag libraries, or help me understand where I am going
wrong?

 

Many thanks in advance,

Matthew giannini

 

<html xmlns="http://www.w3.org/1999/xhtml"

      xmlns:c="http://java.sun.com/jsp/jstl/core">

<head>

    <title>JSP Tutorial Stuff</title>

</head>

<body>

  <table>

    <tr>

      <th>Value</th>

      <th>Square</th>

    </tr>

    <c:forEach var="x" begin="0" end="10" step="2">

      <tr>

        <td>

          <c:out value="${x}"/>

        </td>

        <td>

          <c:out value="${x * x}"/>

        </td>

      </tr>

    </c:forEach>

  </table>

</body>

</html>

 

 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message