Thanks for your answer ! I'll have a look at VelocityViewServlet.

One thing about toolbox. For example i have such very simple tool

public class testToolbox
{
    public String testStr = null;

    //some init here
    public testToolbox()
    {
        //when construcor executing ?
        System.out.println("Constructor is working");
        this.testStr = new String("Test string here");
    }

    public String getTestStr()
    {
        return this.testStr;
    }

    public void setTestStr(String testStr)
    {
        this.testStr = testStr;
    }
}

In toolbox.xml :

<tool>
    <key>ttool</key>
    <scope>request</scope>
    <class>testToolbox</class>
</tool>

I see that constructor is executing every time i request something
from toolbox. It's not all OK here. I guess i'm missing something, but
what ?

On 10/14/05, Nathan Bubna <[EMAIL PROTECTED]> wrote:
> oh.  heh.  it would have to be something more complicated like that.
> well, here's what i know:
>
> VelocityServlet is deprecated, and the VelocityViewServlet what most
> people use for Velocity integration with Struts (seeing as it is part
> of VelocityStruts).  I'm guessing since you didn't like my first
> suggestion there is some exceptional reason you must use the
> VelocityServlet and not the VelocityViewServlet, right?
>
> the big add of the VVS is that it can automatically add the
> VelocityStruts tools to the context.  VelocityServlet doesn't have
> toolbox support like that, so you would have to add the VelocityStruts
> tools (and initialize them) your self.  this, of course, still means
> you must depend on the VelocityTools project.  so, hopefully that's
> not a problem.  anyway, the steps you'll need to take should be
> something along the lines of:
>
> - override VelocityServlet.createContext()
> - instead of creating a plain VelocityContext, create a ChainedContext
> (part of VelocityTools)
> - create instances of the VelocityStruts tools you need (e.g. StrutsLinkTool)
> - pass the ChainedContext instance to the tools' init(Object) methods
> - add the tools to the ChainedContext
> - return the ChainedContext
>
> if for some reason you can't use VelocityTools, all i can recommend is
> that you mimic what the class above would do in your own code.
>
> On 10/14/05, Stas Ostapenko <[EMAIL PROTECTED]> wrote:
> > Hello Nathan !
> >
> > Google is not so helpful when you try to answer my question. As you
> > maybe pointed out (or not ?) that i'm not asking about velocity+struts
> > integration, but VelocityServlet+struts.
> >
> > Thanks for help.
> > On 10/14/05, Nathan Bubna <[EMAIL PROTECTED]> wrote:
> > > google is helpful. ;-)
> > > http://www.google.com/search?q=velocity+struts
> > >
> > > On 10/14/05, Stas Ostapenko <[EMAIL PROTECTED]> wrote:
> > > > Hi !
> > > >
> > > > I'm looking for VelocityServlet and Struts integration. Is there any ?
> > > > It's not diffcult to implement, but how about ready-to-use thing ?
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to