IPage.getVisit() will force the creation of the Visit (and, thus, the HttpSession). IEngine.getVisit() will not create the Visit.
You might want to override beginResponse() to force the creation of the Visit before the HttpServletResponse is created (after which, you can get an error if you try to create a HttpSession since the timing must be before the response, to ensure that the cookie can be sent to the client). -- [EMAIL PROTECTED] http://tapestry.sf.net > > Normally, to share information between many pages, you would store the > value > > persistantly as a property of the Visit. > > Yeah, after thinking about it more, it's probably best to make it a property > of the Visit object. > > Quick question.....is there any way to force Visit instantiation > immediately? This component resides on the home page....therefore it could > potentially make a call to the Visit object before it's created. > > Thanks, > Eric > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: "Eric Schneider" <[EMAIL PROTECTED]> > Cc: "Tapestry Contrib" <[EMAIL PROTECTED]> > Sent: Thursday, January 02, 2003 1:50 PM > Subject: Re: [Tapestry-developer] detaching persisitent component properties > > > > When we say that a component has a persistant property, it's that exact > > component, within that exact page. Another component on the same page, or > on > > another page, is independent and won't share that persistant property. > > > > Normally, to share information between many pages, you would store the > value > > persistantly as a property of the Visit. > > > > If you are creating a vertical component (reusable in different > applications) > > you can create a parameter for the component that you wire to a property > of > > your visit, or you can bypass Tapestry and store an attribute directly > within > > the HttpSession, i.e., > > > > > getPage().getRequestCycle().getRequestContext().getSession().setAttribute > > ("foo", bar); > > > > > > > > -- > > [EMAIL PROTECTED] > > > > http://tapestry.sf.net > > > Hey all, > > > > > > I just want to make sure I have this right.....cuz it seems like it's > not > > > working right now. > > > > > > Can someone give me an example on how to detach persistent component > > > properties? I believe I have my head around detaching page properties, > but > > > components seem to be giving me grief. > > > > > > I have a search form component that standard on most pages. I'll like > to > > > retain the user's search criteria in the text field in later pages. > > > According to the documentation, the component class must implement the > > > PageDetachListener interface and all properties can be cleared in the > > > pageDetached() method. I think I've done this correctly. > > > > > > Here's what I have so far....my component extends BaseComponent and > > > implements PageDetachListener. > > > > > > private String searchInput; > > > > > > public void setSearchInput(String value) { > > > searchInput = value; > > > fireObservedChange("searchInput", value); > > > } > > > > > > public void pageDetached(PageEvent event) { > > > playerName = null; > > > } > > > > > > Is this all that is required? New users seem to be getting other > people's > > > search criteria. It seems the property isn't being detached properly. > > > > > > Ideas? > > > > > > Thanks > > > Eric > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > Tapestry-developer mailing list > > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/tapestry-developer > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Tapestry-developer mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/tapestry-developer
