Ok. I tried and tried and I cannot get the ServletConfig to where I
need it so
I can create a new VelocityView. The best I can get is a ServletContext.
------------------------------------------------------------------
VelocityView velocityView = new VelocityView( getServletContext() );
Context context = velocityView.getContext( request, response );
------------------------------------------------------------------
And, looking at the code for VelocityView, when you create a new
VelocityView
with a ServletContext, it never calls the init(ServletConfig config) method.
So, the tools don't get configured. When I do $params.get('thing') it
tells me:
Request is null. ParameterTool must be initialized first!
So, I tried it the "standalone" way:
------------------------------------------------------------------
ToolManager manager = new ToolManager();
if( getToolboxConfigLocation() != null )
{
manager.configure( getServletContext().getRealPath(
getToolboxConfigLocation() ) );
}
manager.setVelocityEngine( getVelocityEngine() );
Context context = manager.createContext();
------------------------------------------------------------------
And I get the same result.
One other attempt was made:
------------------------------------------------------------------
ViewToolContext context = new ViewToolContext( getVelocityEngine(),
request, response,
getServletContext() );
------------------------------------------------------------------
This time, no errors. But the tools don't work. I see a bunch of
$link.setRelative()
all over the page. Nothing renders.
Am I close? Way off? Any help is much appreciated.
Thanks again.
Charlie
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]