Hi again,

I extended TemplatePageAttributes with TemplatePageExtendedAttributes to include some 
new methods:

package de.geoconnect.audiotex.turbineext;

public class TemplatePageExtendedAttributes extends TemplatePageAttributes implements 
ApplicationTool
{
 ...
    public TemplatePageAttributes setScript(String url)
    {
        data.getPage().getHead().addElement(new Script().setSrc(url)
                .setType("text/javascript").setLanguage("JavaScript"));
         return this;
     }
         
}

... and modified the corresponding entry in TR.props:

tool.request.page=org.apache.turbine.util.template.TemplatePageExtendedAttributes

Now, when accessing my new method in my Default.vm template

$page.setScript("resources/audiotex.js")

I get the following error:

Horrible Exception: org.apache.velocity.exception.MethodInvocationException: 
Invocation of method 'setScript' in  class 
de.geoconnect.audiotex.turbineext.TemplatePageExtendedAttributes threw exception class 
java.lang.NullPointerException : null

I have placed the file audiotex.js in webapps\resources.

What's wrong here?
I'm grateful for any hint.

Marc


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

Reply via email to