---- Original Message -----
From: "Jason Wells" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>


> But according to the JSP 1.1 spec (section 2.10.1), the method within the
> declaration tags (that is, <%! %>) doesn't produce output to the "out"
> object. So if that's true, how come this code works? Am I wrong in
assuming
> that all HTML in a JSP page gets streamed out the JspWriter "out" object?

The code works because the portion "A chuck of html." is not within the <%!
%> block.
So it becomes part of the _jspService method and has access to JspWriter
"out" object.


> I looked at the servlet that Tomcat generated for this JSP, because I was
> curious about how someMethod() was implemented in the servlet Tomcat
> produced. What I found left me even more puzzled:
>
> public void someMethod()
> {
>     // end
>     // begin
>
[file="/usr/local/jakarta/jakarta-tomcat-3.2.1/webapps/stest/mydemo.jsp";fro
> m=(17,3);to=(19,0)]
>
> }
>
> Can anyone explain this? I found no mention of this "// begin" statement
in
> the servlet or JSP specs, nor in any manuals. Is this Tomcat-specific?

The comments (//begin &  //start)that you are seeing in the generated code
for the Servlet are definately Jasper (the JSP engine in Tomcat) specific.
If you look at the generated file you will find another begin before
someMethod() something like

// begin [file="C:\\jsp\\testAll.jsp";from=(5,3);to=(8,0)]

These are comments put by Jasper to relate the generated code to the JSP and
seems to appear in pairs of *start* and *end* comments.
Any other JSP engine may not need to put these comments.
Jasper it seems takes the declaration elements as they appear in the JSP and
puts them in the same order in the generated Servlet and puts a comment as
to the source of this code in the JSP.
That is the behaviour you are seeing.


Regds,
Gokul

> Jason Wells
> Web Architect
> Xsilogy, Inc.
> http://www.xsilogy.com/

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to