velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Fixler <>
Subject Re: AbstractSearchTool + Struts
Date Thu, 11 Nov 2004 22:45:55 GMT
Thanks Shinobu.

I think I didn't phrase what I was asking so well.  In my understanding  
of the way VelocityStruts works, a request goes

request->Struts Actions->VelocityViewServlet->vtl template

And what I really wanted to do was parse my query and manipulate my  
AbstractSearchTool inside the relevant Struts Action, and then let  
control get passed to VelocityViewServlet, etc.

I can see that VelocityViewServlet gets a ToolboxManager using  
ServletToolboxManager.getInstance(servletContext, file), but there  
doesn't seem to a way to share the tools easily elsewhere.

OTOH, looking at the docs again, maybe the way I pictured it just isn't  
the way to do it.  It looks like the only way to have interaction  
between the Struts action and the tool is to do a  
request.setAttribute() in the preceding action and then look for an  
attribute in the tool's setup() method.

thanks again, and sorry if I'm being thick

On Nov 11, 2004, at 1:39 PM, Shinobu Kawai wrote:

> Hi Eric,
>> Hi.  I'd like to use AbstractSearchTool (or it's apparently incipient
>> replacements), and I'm also using Struts.  I think I understand all  
>> the
>> individual pieces, but I'm missing part of the big picture, i.e. where
>> does the SearchTool get instantiated.
>> Let's say I've done the following -
> ## snip
>> How does (Or how would I make sure that) my SearchTool get
>> instantiated, executed, and placed in the context at the key  
>> designated
>> in the toolbox file?
>> If there's a doc page on this, please point me to it...
> AbstractSearchTool is the same as any other tool.
> index.html#Toolbox%20Configuration
> For an example of toolbox.xml entry,
> tools/view/tools/AbstractSearchTool.html
> For the actual code,
> tools/view/servlet/ 
> VelocityViewServlet.html#initToolbox(javax.servlet.ServletConfig)
> tools/view/ViewToolInfo.html#getInstance(java.lang.Object)
> Best regards,
> -- Shinobu Kawai
> -- 
> Shinobu Kawai <>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
Eric Fixler

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message