You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Cliffano Subagio <cs...@yahoo.com.au> on 2002/04/28 17:42:48 UTC

retrieveing data using ${foo.bar} (JSTL examples)

I downloaded and ran JSTL examples.
And I got confused where is the data from, for the example (the fact that I
tried to understand the code at 4am in the morning might affect the brain)

Particularly at elsupport/Expr.jsp
the code
<c:out value="${customer.phoneHome}" default="no home phone specified"/>
for "Mikita" gives "(320)876-9784".

A quick search for the string "876-9784" reveals that the file Init.class
located at WEB-INF/classes has that string.
How does this Init.class actually store this data (876-9784)?

In general, how to store data such that it can be retrieved by using
${foo.bar}?

Thank you.

=====
Cliffano Subagio

http://messenger.yahoo.com.au - Yahoo! Messenger
- A great way to communicate long-distance for FREE!

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: retrieveing data using ${foo.bar} (JSTL examples)

Posted by Shawn Bayern <ba...@essentially.net>.
On Mon, 29 Apr 2002, [iso-8859-1] Cliffano Subagio wrote:

> Particularly at elsupport/Expr.jsp
> the code
> <c:out value="${customer.phoneHome}" default="no home phone specified"/>
> for "Mikita" gives "(320)876-9784".
>
> A quick search for the string "876-9784" reveals that the file Init.class
> located at WEB-INF/classes has that string.
> How does this Init.class actually store this data (876-9784)?

In the specific case of the standard-examples application, the 'Init'
class is a ServletContextListener used to establish some sample data in a
ServletContext (i.e., the "application" scope).

> In general, how to store data such that it can be retrieved by using
> ${foo.bar}?

In general, the information comes from scoped attributes, which can be set
by servlets, listeners, filters, scriptlets, custom tag handlers, and
other JSTL tags.

-- 
Shawn Bayern
"JSP Standard Tag Library"   http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>