But in his case he actually wanted the string constant "i" (not a
variable) to be inserted between "<scr" and "pt>" in order to fool the
parsing engine so that it wouldn't try to process the javascript block.  It
seems odd to me that the jsp engine would process the javascript block
anyway, but that was the original dilemma.

Brien Voorhees

----- Original Message -----
From: Craig McClanahan <[EMAIL PROTECTED]>
To: Brien Voorhees <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 05, 1999 10:53 AM
Subject: Re: JavaScript in JSP (whoops)


>
>
> Brien Voorhees wrote:
>
> > Duh.  I meant :
> > Shouldn't that be <%="i"%>, though?.
> > Brien
> >
>
> At least for JSP 1.0, it should be:
>
>     <%= i %>
>
> You can actually include any Java expression that returns a string value
in such a
> scriptlet.  For example, if you have a customer bean with id "customer"
that has a
> "name" property, you might use the following:
>
>     The customer name is <%= customer.getName() %>.
>
> This is also quite useful when creating input forms where you want the
default
> value to be the current value in this field.  For example:
>
>     <tr>
>         <th>Customer Name:</th>
>         <td><input type="text" name="name" size=50
>              value="<%= customer.getName() %>"></td>
>     </tr>
>
> Of course, using this scriptlet ties you to the underlying language you
are using
> (Java in this case), because the text must be a valid expression in that
language.
> Use <jsp:getProperty> if you need a more language-neutral means to
retrieve
> properties from beans.
>
> Craig McClanahan
>
>
>

===========================================================================
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

Reply via email to