[Opensource] Calling two states within the same request
larry hamel
expresso at codeguild.com
Mon Sep 9 10:40:01 PDT 2002
Hello Malcolm,
so the problem has to do with multiple state parameter somewhere in the submitted form? If you have multiple parameters with the same name, I think the last one wins.
if you look at the source HTML that arrives at your browser, can you determine what the last state parameter is?
Can you manipulate the page creation such that the last state parameter holds the correct value? or get rid of the "extra" param?
Good luck,
Larry
At 06:42 AM 9/9/2002, you wrote:
>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
>*************************************************************************
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/
More information about the Opensource
mailing list