You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hubert Rabago <ja...@yahoo.com> on 2004/02/05 02:18:30 UTC
Re: Action without ActionForm
You can also declare a dummy form.
<struts-config>
<form-beans>
<form-bean name="currentTimeForm"
type="org.apache.struts.action.DynaActionForm" />
</form-beans>
<action-mappings>
<action path="/currenttime"
type="com.somecompany.CurrentTimeAction"
name="currentTimeForm">
<forward name="success" path="/CurrentTime.jsp" />
</action>
</action-mappings>
...
- Hubert
--- Srinivas Kusunam <SN...@kcc.usda.gov> wrote:
>
> If there is no ActionForm <html:form> doesn't work. Try with normal <form>
> tag it works fine.
>
> Hope this helps.
>
> Srini
>
>
> >>> nakane@mie-com.co.jp 02/04/04 07:00PM >>>
>
> Hi ,all
>
> I am new to Struts and learning it.
>
> And I am wondering how the strtus-config.xml and JSP look like when
> a JSP doesn't submit any info( dont need ActionForm) .
>
> The JSP just display the current time and has one button "refresh".
>
> CurrentTime.jsp ( user push refresh button)
> -> CurrentTimeAction(get current time and put it to Session Attribute)
> -> CurrentTime.jsp ( get time from Session and render)
>
> I have made the JSP without Struts framework . it works .
>
> but I have no idea how I can make this with action mapping in
> struts-config.xml.
> I made the mapping below and I got error when I try to open the JSP .
> JSP is using <html:form> tag to make form.
>
> javax.servlet.jsp.JspException: Cannot retrieve definition for form bean
> null
>
> but i dont need any ActionForm
> ---------------------------------------------
> <action-mappings>
> <action path="/currenttime"
> type="com.somecompany.CurrentTimeAction">
> <forward name="success" path="/CurrentTime.jsp" />
> </action>
> </action-mappings>
> -----------------------------
> I have already checked the which attribute of action tag is mandatory or
> optional .
> Should I make dummy ActionForm ?
>
>
> Any comments are appriciated.
>
> Masashi Nakane
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Action without ActionForm
Posted by Masashi Nakane <na...@mie-com.co.jp>.
Thanks ,
Both work fine.
but Using-normal-form way needs a little change of the action attribute
URL of form tag inJSP.
I had to change
from <html:form action="/currenttime">
to <form action="testAPP/currenttime.do">
testAPP is root of this webapp
So, I choose the Using-dummy-actionform way for resemblance with other JSPs.
Thank you again.
At 17:18 04/02/04 -0800, you wrote:
>You can also declare a dummy form.
>
>- Hubert
>
>--- Srinivas Kusunam <SN...@kcc.usda.gov> wrote:
> >
> > If there is no ActionForm <html:form> doesn't work. Try with normal <form>
> > tag it works fine.
> > Srini
> >
> >
> > >>> nakane@mie-com.co.jp 02/04/04 07:00PM >>>
> >
> > Hi ,all
> >
> > I am new to Struts and learning it.
> >
> > And I am wondering how the strtus-config.xml and JSP look like when
> > a JSP doesn't submit any info( dont need ActionForm) .
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org