Re: Diff between <@ and
thanks for your notes.
still when i run JRun web server, it identifies
<!--#page info="a hello world example" -->
and
<!--#include file="dukebanner.html" -->.
i do not know why this happens and the the page loads
properly.
if i use
<%@ include file="dukebanner.html" %>
the compiler shows a JSP parse error.
why is this happening.
Anup
--- Michael Hu <[EMAIL PROTECTED]> wrote:
> Anup wrote:
>
> > what is the difference between <@ and <!--. It
> seems that only the latter
> > works for JSP when using Jrun Webserver. Or am I
> missing something.
> >
> > Is <%== another way of putting out.println.
>
> <@ are JSP directives: they affect the rest of the
> JSP page and act like
> pre-processor directives.
>
> <%! is an object level variable declaration. Each
> JSP page is compiled into a
> servlet with a method: public void
> _jspService(HttpServletRequest request,
> HttpServletResponse response) throws IOException,
> ServletException which gets
> called when the page is to be serviced.
> Thus, <% int a; %> declares a local variable in the
> _jspService method, while <%!
> int a; %> declares a member variable of an instance
> of the servlet itself. This
> distinction is important if the JSP implementation
> clones servlets to service
> multiple requests; <%! int a; %> will get cloned
> since it belongs to the object,
> but local variable <%int a; %> will not.
>
> <!-- --> is an HTML comment. This gets outputted to
> the response page "as is" by
> the JSP engine. The browser will recognize this as
> a comment and not display it to
> the user; however, the user can view the page's
> source and read the comment. <%--
> --%> is a JSP comment, and is completely ignored by
> the JSP engine and is not sent
> to the response page; hence, the user will never see
> it, even if the page's source
> is "viewed."
>
> <%= is equivalent to out.print(). Therefore <%== %>
> translates to out.print(=)
> which will give a JSP compiler error.
>
> --
> Michael Hu, Paradox Team, Corel Corporation
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
>
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
- Diff between <@ and <!-- Anup
- Re: Diff between <@ and <!-- Michael Hu
- Anup
