you could try the following
<logic:equal name="pageName" value="futureInfoList">
<c:set var="formAction" value="showFutureRec"/>
</logic:equal>
<logic:equal name="pageName" value="pastInfoList">
<c:set var="formAction" value="showPastRec"/>
</logic:equal>
<html-el:form action="${formAction}">
...
-----Original Message-----
From: Masashi Nakane [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 6 April 2004 2:26 PM
To: Struts Users Mailing List
Subject: 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]