You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Scott Ellsworth <sc...@alodar.com> on 2004/06/27 20:37:26 UTC
How best to do stateless query application?
Hi, all.
I have been using Tapestry to do a web app that controls some biotech
gear.
We have thus far been doing single page stateless applications, or
applications where a form has a submit button that takes you to a
"thank you" page, and that has gone well.
I have now been asked to create search functionality - vis; the main
page is a query form with a plate number and a "do search button".
When you hit that, it takes you to a query results list page, which I
can build with a table. That table is just a bunch of links to
individual detail pages. I suspect I can put that together give
Howard's book and some effort, given that the form and thank you page
seems to work.
The problem I am having is how to keep this stateless - once the query
is sent off and the new page starts to render, I do not need any kind
of session state.
How would I have the submit button send parameters to a page if not
through the Visit? E.g. if the main app page is at
localhost:9006/systemStatus, what kind of code could launch
systemStatus/doSearch?seachTerm=Plate1234, which could then do the
search and produce results without caring how it was called.
I suspect that it would not be that hard to set some session variables,
then move to another page that pulls the variables out of the visit,
but that forces me to keep session state around, and this is going to
be a high visibility app, so I do not want Tomcat to have to keep
sessions around.
Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How best to do stateless query application?
Posted by Michael Henderson <mh...@mac.com>.
Hi,
Generate the links to the detail page in your results page using the
ExternalLink component
use the parameters binding to pass the key or keys of each result
object.
The detail page must implement IExternalPage and can use the parameters
to determine
which detail object to display.
No visit, no need to store the results list if the detail page can use
the parameters to lookup the result object.
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How best to do stateless query application?
Posted by Jonny Wray <jo...@yahoo.com>.
Scott,
I do this all the time, it's one of the beauties of Tapestry in my view. I
only use the visit for things that are truly visit related, and not for
passing around parameters from page to page.
Pages are java objects, thus in your form listener, after you have the
search results, you can get the page object and call a set method on that
page to populate the pages result set, then activate the page.
Don't have any code in front of me for the exact syntax, but this is the
general idea.
Jonny
On 6/27/04 11:37 AM, "Scott Ellsworth" <sc...@alodar.com> wrote:
> Hi, all.
>
> I have been using Tapestry to do a web app that controls some biotech
> gear.
>
> We have thus far been doing single page stateless applications, or
> applications where a form has a submit button that takes you to a
> "thank you" page, and that has gone well.
>
> I have now been asked to create search functionality - vis; the main
> page is a query form with a plate number and a "do search button".
> When you hit that, it takes you to a query results list page, which I
> can build with a table. That table is just a bunch of links to
> individual detail pages. I suspect I can put that together give
> Howard's book and some effort, given that the form and thank you page
> seems to work.
>
> The problem I am having is how to keep this stateless - once the query
> is sent off and the new page starts to render, I do not need any kind
> of session state.
>
> How would I have the submit button send parameters to a page if not
> through the Visit? E.g. if the main app page is at
> localhost:9006/systemStatus, what kind of code could launch
> systemStatus/doSearch?seachTerm=Plate1234, which could then do the
> search and produce results without caring how it was called.
>
> I suspect that it would not be that hard to set some session variables,
> then move to another page that pulls the variables out of the visit,
> but that forces me to keep session state around, and this is going to
> be a high visibility app, so I do not want Tomcat to have to keep
> sessions around.
>
> Scott
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org