> From: Charles N. Harvey III [mailto:[EMAIL PROTECTED]]
> 
> Without said tool I have to specifically put my UserBean into the context
> in each servlet that would use it.  The tools way, it is always there,
> ready
> for use.
> 
> Now, I'm not that familiar with Maverick yet, but it may already be doing
> this some other way.  What the equivalent in domify would be a block of
> xml
> being added to the dom for each object/class that I define.  So that in
> any
> one of my xsl pages I could access <xsl:value of="//user/lastName"/> and
> <xsl:value-of="//user/firstName"/>.

Hmmmm.  I believe that for XSL there are no direct parallels; this
particular task is a strength of Velocity and a weakness of XSL.  However,
what you describe can be done as part of your application rather than part
of Maverick:

If you're using Throwaway controllers, have all of your controllers extend a
base controller class that has a getUser() method which simply returns a
tool object obtained from the application context.

Thus the "tool" would always be available in xpath as:

<xsl:value-of select="//model/user/lastName"/>

Note that you still can't do neat tricks like call java methods that take
parameters.  The amazingly powerful thing about Velocity which has no
equivalent in XSL or JSTL is the ability to do this:  $user.foo('bar')

You can do something roughly like that in XSL by defining a custom URI
resolver (it's a configuration option on XSLTransformFactory) and using the
document() function, but it's not as flexible as the Velocity scheme.

> Does my explanation sound crazy?  Am I making sense?  Because it doesn't
> seem
> like it when I read over this message.

Makes sense.  I use tools myself; most of my personal development is done
with Velocity (and Maverick).  Someday I hope to talk Maxis into using
Velocity - it's way better than JSTL.

> And just to make clear with my first question.  I define the
> DomifyViewFactory
> and then point my command to a controller and a view and my collections
> will
> 'automagically' be part of the dom?  Neato.

Yup, you got it.  Neat, huh?  :-)

BTW, enable the maxTransforms feature (check the javadocs for
XSLTransformFactory, or examine the maverick.xml for friendbook-domify) and
then add ?maxTransforms=0 to the request url for a page.  You'll get the raw
output of your controller as XML - very useful for debugging or offline
development.  This is what I miss most about developing with XSLT.

Jeff Schnitzer
[EMAIL PROTECTED]


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Mav-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mav-user
Archives are available at http://www.mail-archive.com/

Reply via email to