You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Ethan Adams <et...@adamsinc.net> on 2001/06/14 15:11:53 UTC

doBuildTemplate getting called twice...Why?

I posted this before, but never got a response.  I'll try again:

I am using TDK 2.1b4 w/JSP for templates.

I make a call like this:

    public void doBuildTemplate(RunData data) throws Exception {
        Log.error("Starting...");
        data.getRequest().setAttribute("problemreports", getProblemReports());
        Log.error("Done!");
    }

The class making the call extends this secure class:

public abstract class MySecureScreen extends BaseJspScreen {
    /**
     * Method that sets up beans and forward the request to the JSP.
     *
     * @param data Turbine information.
     * @return null - the JSP sends the information.
     * @exception Exception, a generic exception.
     */
    public ConcreteElement buildTemplate(RunData data)
        throws Exception {

        if(isAuthorized(data)) {
            super.buildTemplate(data);
        }
        else {
            //do some redirect
        }

        return null;
    }

    protected abstract boolean isAuthorized(RunData data)
        throws Exception;
}

Problem is I keep getting 2 entries in the log for 1 call to the page.  It would seem to me that doBuildTemplate is being called twice.

Example:
[Wed Jun 13 10:28:30 EDT 2001] -- ERROR -- Starting...
[Wed Jun 13 10:28:30 EDT 2001] -- ERROR -- Done!
[Wed Jun 13 10:28:30 EDT 2001] -- ERROR -- Starting...
[Wed Jun 13 10:28:30 EDT 2001] -- ERROR -- Done!

Can anyone shed some light on this?


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: doBuildTemplate getting called twice...Why?

Posted by Jason van Zyl <jv...@apache.org>.
On 6/14/01 9:11 AM, "Ethan Adams" <et...@adamsinc.net> wrote:

> I posted this before, but never got a response.  I'll try again:
> 
> I am using TDK 2.1b4 w/JSP for templates.
> 
> I make a call like this:
> 
>     public void doBuildTemplate(RunData data) throws Exception {
>         Log.error("Starting...");
>         data.getRequest().setAttribute("problemreports", getProblemReports());
>         Log.error("Done!");
>     }
> 
> The class making the call extends this secure class:
> 
> public abstract class MySecureScreen extends BaseJspScreen {
>     /**
>      * Method that sets up beans and forward the request to the JSP.
>      *
>      * @param data Turbine information.
>      * @return null - the JSP sends the information.
>      * @exception Exception, a generic exception.
>      */
>     public ConcreteElement buildTemplate(RunData data)
>         throws Exception {
> 
>         if(isAuthorized(data)) {
>             super.buildTemplate(data);
>         }
>         else {
>             //do some redirect
>         }
> 
>         return null;
>     }
> 
>     protected abstract boolean isAuthorized(RunData data)
>         throws Exception;
> }
> 
> Problem is I keep getting 2 entries in the log for 1 call to the page.  It
> would seem to me that doBuildTemplate is being called twice.
> 
> Example:
> [Wed Jun 13 10:28:30 EDT 2001] -- ERROR -- Starting...
> [Wed Jun 13 10:28:30 EDT 2001] -- ERROR -- Done!
> [Wed Jun 13 10:28:30 EDT 2001] -- ERROR -- Starting...
> [Wed Jun 13 10:28:30 EDT 2001] -- ERROR -- Done!
> 
> Can anyone shed some light on this?

I'll take a peek, I am going to give the view mechanism a
scrub down this weekend so I'll use your example here to
track down the problem. Other people have mentioned this
too.

-- 

jvz.

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org