Thanks for your reply Sachin.  :)

You seem to be saying "Well of course you can't do that within declaration
tags. Go and read up on JSP tags to improve your understanding" hehe. Thanks
for the advice, but I'm not sure you fully understood my question. It's a
legitimate one I think. Let me expand...

The supplied syntax is illegal for JSP because JSP translators consciously
reject HTML embedded in method declarations. We're in agreement on that -
they are built to work that way, no arguments.

My question is: "Why? Why are the JSP translators built not to accecpt HTML
embedded in method declarations?". I'm not saying that JSP should or that it
shouldn't support this syntax; my goal is to understand if there is a good
reason why JSP translators work this way. For all I know, there is a very
good reason. As mentioned, JSPs primary competitor (ASP) does accept the
syntax, and this is very handy. And, I do think there is an argument along
the lines of, "Well the whole idea of server pages is the blend of HTML and
code. Why not support HTML embedding even within declarations of methods?"

I can see that if this were to work, the declared method with the embedded
HTML would have to have a signature that included a JSPWriter parameter.
Beyond that, I can't see a barrier to translators being able to handle HTML
embedded in method declarations. But I accept that just because I cannot see
a problem, that there isn't one. Hence my query to this list.

What do you think? Is there a good reason why this syntax is not supported?
Or, perhaps, it is supported by some vendors and not others?

Rob


----- Original Message -----
From: "Sachin S. Khanna" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 16, 2001 11:39 PM
Subject: Re: Inner scriptlet tags


> Well <! .... > this is a jsp declaration and not a scriptlet.
> There has been a lot of discussion on the difference, use of jsp
declaration
> and scriptlets.
> All of which can be found at the mail archives of this list.
> Please help yourself as well as this list by searching for them out there.
> Have a nice day.
> With regards,
> Sachin S. Khanna.
> www.emailanorder.com
>
> ----- Original Message -----
> From: Rob L'Estrange <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, March 18, 2001 3:42 AM
> Subject: Inner scriptlet tags
>
>
> > Hi All
> >
> > I've been developing with ASP for sometime and have finally got around
to
> > checking out JSP.
> >
> > I've come across something curious. In the source code at the bottom of
> this
> > email, the highlighted code would be permissible (semantically) in ASP
but
> > is not permissible in JSP. I'm using Tomcat 3.2.
> >
> > I understand where the translator is "breaking down" and why - in short,
> the
> > translator has been built not to process scriptlet tags within a
> declaration
> > tag. And I understand that there are ways of achieving the same result,
> and
> > that not all people would see this feature as necessary. But... I have
> found
> > the technique useful in ASP development - which is the same as saying,
for
> > me at least, the technique is useful in server page development. Is
there
> a
> > good reason why JSP translators are not built to handle this kind of
> syntax?
> >
> > Thanks
> > Rob
> >
> > ==================================
> >
> > <%@ page language="Java" %>
> >
> > <%!
> >
> > private void testMethod(){
> >  /* Start: Here's the violating code. */
> >  %>
> >  <p align="center">How are you today?</p>
> >  <%
> >  /* End: The violating code. */
> > }
> >
> > %>
> >
> > <html>
> > <head>
> >  <title>Hello</title>
> > </head>
> >
> > <body bgcolor="#FFFFFF">
> >  <h1 align="center"><font face="Arial" color="#0000FF">Hello</font></h1>
> >
> >  <%
> >  testMethod();
> >  %>
> >
> > </body>
> > </html>
> >
> >
>
===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to