jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Bergsten <h...@gefionsoftware.com>
Subject Re: taglib roadmap and practices
Date Sun, 24 Dec 2000 04:45:34 GMT
Hans Bergsten wrote:
> 
> Dennis Sosnoski wrote:
> >
> > My initial reaction to the '$name' notation was "yuck", but on thinking it over
> > it does make a lot of sense. The current expression notation in JSP is just too
> > cumbersome.
> >
> > It'd probably be easy to implement the expression identifier filter as a patch
> > to Tomcat in order to demonstrate this approach. It might be worthwhile to
> > extend the notation to handle full expressions as "$(expr)" in addition to the
> > simpler "$name" used to just substitute the text form of a variable. I'd
> > definitely find this very useful - it'd make it much easier to use standard HTML
> > tools with JSPs. [...]
> 
> If you're interested in extended version of this model, you can take
> a look at our InstantOnline Basic tag library. It uses variables,
> expressed
> as $name$ in it's simplest form for all kinds of dynamic input. The
> full syntax allows you to specify the scope where the data is located,
> a default value to use if it's not found, a data type and a format if
> it needs to be interpreted and converted to a Java object (such as a
> string representing a date in a SQL query) or formatted for output (e.g.
> a Date object to be added to the response).
> 
> So, for instance, if I have a form with a date field, the JSP page
> invoked by the form can contains an action element like this:
> 
>   <iob:dbStore dbName="poolName" table="Test"
>     columns="ADateCol"
>     values="$http|dateField|2000-01-01|date|yyyy-MM-dd"
>   />
> 
> This looks for an HTTP parameter named "dateField" and converts
> it to a java.util.Date (use with setDate() in a ParsedStatement)
> by parsing the string using the format "yyyy-MM-dd". If the
> parameter is not found, the default "2000-01-01" is used instead.
> 
> Using a variable name like "foo.bar", bean properties can be
> accessed as well:
> 
>   <iob:dbStore dbName="poolName" table="Test"
>     columns="ADateCol"
>     values="$request|mybean.someDate|2000-01-01|date|yyyy-MM-dd"
>   />
> 
> The Reference Manual describes the complete syntax, all scopes,
> etc. The User's Guide contains a number of examples.

Duh, a URL may help:

  <http://www.gefionsoftware.com/InstantOnline/>

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

Mime
View raw message