You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Masashi Nakane <na...@mie-com.co.jp> on 2004/04/06 06:25:59 UTC

1JSP and multiple forms ,which have session scope

   Hi, all

Can 1 JSP change submit point(action map which means action and form bean)
under some condition ?
like

---------  xxxx.jsp ----------------
<%--  from here search conditions form--%>.

<logic:equal  name="pageName" value="futureInfoList">
	<html:form action="showFutureRec">
</logic:equal>
<logic:equal  name="pageName" value="pastInfoList">
	<html:form action="showPastRec">
</logic:equal>

	<html:input property="customerName"/>
	<html:input property="customerNumber"/>


	<logic:equal  name="pageName" value="futureInfoList">
		<html:hidden property="dateCondition" value="todayOrFuture">
	</logic:equal>
	<logic:equal  name="pageName" value="pastInfoList">
		<html:form property="dateCondition" value="past">
	</logic:equal>


</html:form>

<%--  from here show List--%>.
<logic;iterate  id="customerOrder" ...... and so on.
--------- xxx.jsp ---------------

but , struts gets angry with that.


In detail ,
  Previously  I had 2 JSPs and each has action and form bean,
  Each JSP has search condition inputs and shows records which are 
retrieved from DB
  according to the inputted search conditions.

   MyFutureRecordList.jsp has the action mapping
		 path="/showFutureRec"
  		 name="FutureRecForm" which made from MyRecordListForm Class.
		 scope="session"
   MyPastRecordList.jsp has the action mapping
		  path="showPastRec"
		  name="showPastRecForm" which made from MyRecordListForm Class.
		  scope="session"

The  same FormBean Class is used,which includes properties both for search 
conditions and for record list,
because MyFutureRecordList.jsp and MyPastRecordList.jsp  are almost the 
same one ,
except for  small difference about hidden search Condition for date.
One is for past Infomation ,the other is for Future Info.

but,  these Jsps' form beans should have session scope to retain the last 
shown info
for users to see same data next time for each page(,but actually one JSP file).

I want to combine these sepatated JSPs into one JSP for maintianability.
Does anyone have ideas about dynamically changing action and form bean in 
one JSP?


Masashi Nakane

  

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org