Another, possibly more Turbine-esque, way to acheive this is to use a session pull tool. This is a little easier than using a the http session since the pull tool is always automatically added to the context. This way you don't have to worry about adding to the http session or to the context.
scott > -----Original Message----- > From: Fabio Daprile [mailto:[EMAIL PROTECTED]] > Sent: Friday, May 03, 2002 5:10 AM > To: Turbine Users List > Subject: Re: Passing objects to context > > > Hello John, > > Another way to pass objects from a screen to another is to > store objects > in the session object. > hereafter an example: > > in the Java code: > > ParameterParser _formParams; > HttpSession _session; > > _formParams = data.getParameters(); > _session = data.getSession(); > > _queueId = _formParams.getInt("Queue"); > _session.setAttribute("QueueId",Integer.toString(_queueId)); > > in the VM: > > $data.getSession().getAttribute("QueueId") > > hope this can help you. > > regards. > > --- > Fabio Daprile > > Wu"rth-Phoenix Srl > Via Kravogl 4, I-39100 Bolzano > Tel: +39 0471/564111 - (direct 564070) > Fax: +39 0471/564122 > > mailto:[EMAIL PROTECTED] > http://www.wuerth-phoenix.com > http://www.wuerth.com > > > John Harris wrote: > > >Please forgive the simplicity of the question, but I'm > trying to learn and become accustomed to turbine. Any help is > greatly appreciated. > > > >How can I carry a vector holding the result of a doSelect > query from one screen to another? For example, if I have the > following code for screen1.vm, with its associated > screen1.java - after the user selects the id, how can > testAction.java grab $resultSet from screen1.vm. > > > >http://localhost/appname/servlet/appname/template/screen1.vm > > > ><form action="$link.setAction("testAction")"> > ><select name="testSelect" id="testSelect"> > >#foreach $record in $resultSet > ><option value=$record.id>$record.name</option> > >#end > ></select> > ></form> > >—------------------------------------------------------- > >public class screen1 extends VelocityScreen { > > public void doBuildTemplate(Rundata data, Context context) > throws Exception { > > > > Criteria crit = new Criteria(); > > crit.add(TablePeer.TYPE, 1); > > Vector ResultSet = TablePeer.doSelect(crit); > > context.put("resultSet", ResultSet); > > } > >} > > > >- John Harris > > > > > >-- > >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
