[Opensource] Calling two states within the same request
Malcolm Wise
malcolm.wise at sde.eu.sony.com
Mon Sep 9 06:42:12 PDT 2002
Hi,
I don't know if this is a bug or I'm doing something stupid, but here
goes...
I have a jsp defined as follows:
<tiles:insert page="/layouts/excalibur-basic-layout.jsp" flush="true">
<tiles:put name="title" value="projects.title" />
<tiles:put name="header" value="/includes/header.jsp" />
<tiles:put name="search" value="/projects/Search/Display.do" />
<tiles:put name="body" value="/projects/jsp/homebody.jsp" />
<tiles:put name="footer" value="/includes/footer.jsp" />
</tiles:insert>
The /projects/Search/Display.do action maps to a controller
'ProjectSearch.java', state 'promptSearch' (the initial state) which
generates a search form with a submit button. The submit button submits the
form to /projects/Search.do which is also mapped to 'ProjectSearch.java',
state 'search' which essentially finds database rows matching the entered
search criteria and displays them. So far, so good.
the /projects/Search.do mapping has a forward 'search' defined which
forwards to the following jsp (projectlist.jsp) to show the search results:
<tiles:insert page="/layouts/excalibur-basic-layout.jsp" flush="true">
<tiles:put name="title" value="projects.title" />
<tiles:put name="header" value="/includes/header.jsp" />
<tiles:put name="search" value="/projects/Search/Display.do" />
<tiles:put name="body" value="/projects/jsp/projectlistbody.jsp" />
<tiles:put name="footer" value="/includes/footer.jsp" />
</tiles:insert>
As you can see, this page needs to show the search form too (as do all my
other pages). Here is where the problem occurs. When the controller
'ProjectSearch.java' gets invoked for the second time (from projectlist.jsp)
to set up the form, it calls the 'search' state instead of the
'promptSearch' state. I've tried changing the <tiles:put name=search value
to /projects/Search/Display.do?state=promptSearch but to no avail. I guess
it's still using the state value from the submitted form. If this isn't a
bug, then any suggestions appreciated as to how to get around this!
Thanks
Malcolm Wise
Technology Manager
Semiconductor & Devices Europe
Tel. +44(0)1256 388864
http://www.semiconductor.sony-europe.com
*************************************************************************
The information contained in this message or any of its
attachments may be privileged and confidential and intended
for the exclusive use of the addressee. If you are not the
addressee any disclosure, reproduction, distribution or other
dissemination or use of this communication is strictly prohibited
*************************************************************************
More information about the Opensource
mailing list