tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: JSP or XML syntax in Tomcat
Date Fri, 09 Nov 2001 23:25:14 GMT


On Fri, 9 Nov 2001, Wineman, Corey J. wrote:

> Date: Fri, 9 Nov 2001 17:40:06 -0500
> From: "Wineman, Corey J." <Corey.Wineman@anser.org>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: JSP or XML syntax in Tomcat
>
> Hello,
>
> When I use the sessionTest.jsp script appended below, the xml format
> "<jsp:scriptlet>" tags are being ignored and the resulting page prints
> the contents of the scriptlet instead of "<h3>New Session</h3>" as I
> expected. When I use the traditional  "<% javacode %>"  format to enter
> scriptlet code, the page works as expected.
>
> I thought you could use traditional JSP syntax or XML syntax in Tomcat.
> As long as you don't mix and match. Am I screwing up the syntax??
>
> -Corey
> ----------------------------------------------
>
> <jsp:directive.page session="true"/>
>
> <html>
> <head>
> <title>Wineman JSP Page</title>
> </head>
> <body bgcolor=white>
>
> <h1>Static content</h1>
>
> <jsp:scriptlet>
>     if( session.isNew() )
>     {
>         out.println( "<h3>New Session</h3>" );
>     }
> </jsp:scriptlet>
>
>
> </body>
> </html>
>
> ----------------------------------------------------

Is this your *entire* page?  If so, it's not valid XML syntax, so it's
being treated as being in the usual JSP syntax.

Chapter 5 of the JSP 1.2 spec covers all the rules about what your page
has to look like, including the fact that it must have a single outermost
<jsp:root> element that conforms to the spec's requirements, and that the
*entie* page must be specified in XML syntax.

The JSP spec is available from
<http://java.sun.com/products/jsp/download.html">.

Craig McClanahan



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message