Hello.
This might be a question for the Spring list but I will try here first.
It seems that the BrowserSnifferTool.init( Object o ) method is not getting
called upon the start of my webapp.  So when I do $browser.getIe() I get
a NullPointerException.  This is because the userAgent is never set in
the init() method.

Here is the setup:

web.xml:
----------------------------------------------------------------------------
<servlet>
 <servlet-name>app</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
 <load-on-startup>10</load-on-startup>
</servlet>
----------------------------------------------------------------------------


app-servlet.xml:
----------------------------------------------------------------------------
<bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.velocity.VelocityLayoutView"/>
 <property name="cache" value="true"/>
 <property name="prefix" value="/app"/>
 <property name="suffix" value=".vm"/>
 <property name="exposeRequestAttributes" value="true"/>
 <property name="exposeSessionAttributes" value="true"/>
 <property name="exposeSpringMacroHelpers" value="true"/>
 <property name="layoutUrl" value="/layouts/default_layout.vm"/>
 <property name="toolboxConfigLocation" value="/WEB-INF/toolbox.xml"/>
</bean>
----------------------------------------------------------------------------

toolbox.xml:
----------------------------------------------------------------------------
<tool>
 <key>browser</key>
 <scope>request</scope>
 <class>org.apache.velocity.tools.view.tools.BrowserSnifferTool</class>
</tool>
----------------------------------------------------------------------------


Every other tool seems to work but this one.  I don't get it.  There is a:
private String userAgent = null; in BrowserSnifferTool and it gets called by
almost every method. Thing is, it stays null because init( Object o ) is never called. I copied BrowserSnifferTool to my project and put log statements into
the init() method, just to make sure it was getting called - no dice.


Any ideas on this are much appreciated.



Charlie





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

Reply via email to