My webapp is standard. It has a left side menu pane
and right side content pane. Both are dynamic and
generated by struts action. I would like to have two
different Actions for menu and content. For the menu
aciton, I would like to use IncludeAction so that is
could be included in my jsps.
Thus, I derived IncludeAction and put me stuff in
execute. But the problem is after everything is done,
where should the action go?
Here is my action code:
public class MenuAction extends IncludeAction {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse respose)
throws Exception {
//my stuff...
return mapping.????;
}
}
Here is my action defination in struts-config.xml:
<action
path="/menu"
type="xxx.MenuAction"
name="menuForm"
scope="request"
validate="true"
parameter="/pages/menu.jsp"/>
Could anyone help?
--- Ray Madigan <[EMAIL PROTECTED]> wrote:
> I would advise you read the sections
> http://struts.apache.org/userGuide/introduction.html
> that explain how an
> ActionForm works and how you get/set the form
> properties.
>
> You need an ActionForm linked to your Action and
> struts will scrape the
> properties from your page into the form and you just
> manage the form.
>
> -----Original Message-----
> From: Joe Smith [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 10, 2005 11:01 PM
> To: [email protected]
> Subject: display the form values from view page
>
>
> register.jsp is the view page, and when the user
> click submit button,
> it will go to result.jsp based on struts-config.xml.
> The followings
> are the code fragment of each significant files.
>
> My question is for result.jsp, I am now using
> request.getParameter("name")
> to get the name property specified in the form. It
> is working code,
> I just want to ask if this is the best appraoch in
> struts application?
>
>
> Please advise. thanks!!
>
>
> register.jsp
> =============
> <html:form action="register.do">
> <P>Name: <html:text property="name"></html:text>
> <P>Address: <html:text
> property="address"></html:text>
> <P>ZIP: <html:text property="zip"></html:text>
> <html:submit>Register Online</html:submit>
> </html:form>
>
>
> result.jsp
> ==========
> <H3>Name = <%= request.getParameter("name") %></H3>
>
>
> struts-config.xml
> =================
> <action-mappings>
> <action name="registerFormBean" path="/register"
> scope="request"
> type="com.insights.struts.actions.RegisterAction"
> input="register.jsp">
> <forward name="success" path="/result.jsp"/>
> </action>
> </action-mappings>
>
>
> RegisterAction.java
> ===================
>
> public ActionForward execute(...)
> {
> //etc...
> forward = mapping.findForward("success");
> }
>
>
---------------------------------------------------------------------
> 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]
>
>
__________________________________
Discover Yahoo!
Stay in touch with email, IM, photo sharing and more. Check it out!
http://discover.yahoo.com/stayintouch.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]