Instanciating the visit on your own is a very bad idea...
I think the best you can is calling getVisit() on a life-cycle method -
I am not sure how they are all called: beforeRender or something like that...
Cheers,
Ron
××××× Edward Scanzano:
Hi all,
I have an application where I need to instantiate the my custom Visit object as early as possible. So, here is my Home.java object and I get a NullPointerException org.apache.tapestry.AbstractPage.getVisit(AbstractPage.java:367)
Am I supposed to instantiate this object somewhere else or does it matter. the web.xml is also included.
Thanks E
package com.intaglio.webclient.site;
import org.apache.tapestry.html.*;
public class CHome extends BasePage { public CHome() { super(); Visit v = (Visit)getVisit(); } }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <!-- generated by Spindle, http://spindle.sourceforge.net -->
<web-app>
<display-name>IntaglioWebClient</display-name>
<filter>
<filter-name>redirect</filter-name>
<filter-class>org.apache.tapestry.RedirectFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>redirect</filter-name>
<url-pattern>/</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>IntaglioWebClient</servlet-name>
<servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
<init-param>
<param-name>org.apache.tapestry.visit-class</param-name>
<param-value>com.intaglio.webclient.site.Visit</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>IntaglioWebClient</servlet-name>
<url-pattern>/app</url-pattern>
</servlet-mapping>
</web-app>
--------------------------------------------------------------------- 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]
