Chris,

One benefit to using <%= expressions is that a JSP file with a lot of
out.printlns in it will look awful in a WYSIWYG HTML editor, but written
with expressions makes things more readable.  But I think you are correct
that you can replace expressions with scriptlets.

Dan
--
Daniel Kirkdorffer
NACN IS: 425-580-6225
Sr. Consultant, Syllogistics LLC
Email: [EMAIL PROTECTED]
Web:   http://www.syllogistics.com/

> ----------
> From:         Chris[SMTP:[EMAIL PROTECTED]]
> Reply To:     Chris
> Sent:         Sunday, July 04, 1999 12:16 PM
> To:   [EMAIL PROTECTED]
> Subject:      Newbie: Diff between <% and <%=
>
> Hi
>
> I've been slogging through the JSP specs and the JSP book (not too
> shabby!), and I think I'm starting to learn a thing or two.
>
> Officially, <% is for scriptlets, <%= is for expressions, right? Well,
> unless I'm mistaken, all <%= is, is a shortcut to save you from typing
> out.println(). But as far as I can tell you never need <%= at all.
>
>
> This would mean that it's not really as if the conceptual space of JSP
> contains two concepts (among others), 'scriptlets' and 'expressions'.
> There's only scriptlets. Since I hate jargon I try and keep my little
> dictionary of new terms (or worse - old terms used in new ways) to a
> minimum, so I wanna know. Also, as a Java guy rather than an HTML guy,
> I'm more comforatble with
>
> <% out.println(dt.getHours()  + ":" + dt.getMinutes() + ":" +
> dt.getSeconds()); %>
>
> than
>
> <%=dt.getHours()%>:<%=dt.getMinutes()%>:<%=dt.getSeconds()%>
>
> (if nothing else it's faster to spot errors in the first for me, cause
> I've got The Eye) so I'd like to maybe just stick to <% if I can.
>
> So I guess my question is - is <%= truly just  a shortcutty kind of
> thing? Or is there more to it than that - do I actually need it
> sometimes.
>
> Thanks,
> Chris
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff JSP-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to