Re: Where does $customers get defined? (Plus some suggestions...)

2002-02-13 Thread Shawn Bayern

On Wed, 13 Feb 2002, Howard Treisman wrote:

 The standard-examples.war file provided with the distribution is excellent.
 However, I had a lot of difficulty understanding ~where~ the value
 $customers comes from in many of the examples. For example:
 
 c:forEach var=customer items=$customers
 
 Where does that pesky $customers come from?

They come from a listener that initializes data when the context starts
up.  The listener is defined in the standard-examples application's
web.xml file:

listener
 listener-class
   org.apache.taglibs.standard.examples.startup.Init
 /listener-class
/listener

The source code to this class is located under the examples/src directory;
it's compiled as part of the build process and included under
WEB-INF/classes in the destination 'examples' application.

 My questions/suggestions are:
 1. Question: Am I vaguely correct?

Yes!  Just to make sure my description was clear, from the root of the
'standard' directory, the path to the source to the 'Init' class is as
follows:

  examples/src/org/apache/taglibs/jsptl/examples/startup/Init.java

 2. Suggestion: Please provide more documentation on the basics of the
 expression language, especially the $ symbol and what it means and how it
 works. (There seems to be quite a bit of confusion about this elsewhere on
 the mailing list.)

Yeah, I agree.  Unfortunately, since the early-access release doesn't
specify or use a single expression language (but instead a pluggable
collection of them for the purposes of experimentation), we weren't able
to document a single one thoroughly.  Even the special meaning associated
with the '$' symbol is up to the individual languages.

 3. Suggestion: Please provide the corresponding .jar files for all the
 .class files in the standard-examples.war.

You mean the individual classes tied to the standard-examples application?  
I guess we could do that, but I wanted to make sure that they didn't get
confused for generally applicable, reusable JARs.  All JARs that you'd
likely want to use in your own applications are made available as JARs.  
Did you have a specific suggestion about which classes might be more
usefully packaged than we're giving them credit for?

 4. Question: I have been unable to find a reference for the web.xml file,
 especially the listener tag - can someone please point me at it.

The web.xml file is described in chapter 13 (Deployment Descriptor) of
the Servlet 2.3 specification, available from java.sun.com.  The
listener tag represents a concept introduced with version 2.3 of the
Servlet specification.

Hope that helps,

-- 
Shawn Bayern
Author, JSP Standard Tag Library  http://www.jstlbook.com
(coming soon from Manning Publications)


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Where does $customers get defined? (Plus some suggestions...)

2002-02-13 Thread Howard Treisman

Shawn
Thank you for your prompt and informative response.

Re:
 3. Suggestion: Please provide the corresponding .jar files for all the
 .class files in the standard-examples.war.

Thanks, I found the source.

The problem I had is that the source for the examples is part of the source
distribution, which is intended for the std-taglib developers, rather than
users. Whereas the standard-examples.jar is intended for users. As a user, I
didn't expect (although in hindsight I should have guessed) to find the
source for the examples mixed up in the source for the tag library itself.

One simple solution is to package up the source for Init.jar into the
std-examples.war for reference purposes (even if that breaks the model of
what a war is supposed to contain.)

Another better solution might be to expose the Init code in a more obvious
way - for example, via embedding in a Init.jsp file, which must be invoked
explicitly (once) by the user prior to running any of the examples.

Again, many thanks for your response.
Howard.


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]