Re: How to clear ActionForm before calling mapping.forward(...)???

2005-03-21 Thread Eric Lemle
Is this what you are looking for? 

 ActionForward cleanDisplay= new ActionForward("/myAction.do?");
 cleanDisplay.setRedirect(true);
 return cleanDisplay; 


put that in your action and run it.

-Eric

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to clear ActionForm before calling mapping.forward(...)???

2005-03-21 Thread Frank W. Zammetti
I *think* I understand what he's trying to do Hubert, but I could be wrong...

I think it's along the lines of "here's a page to edit an employee, and
every time I hit Continue I want to see that same page again but with no
values (think a loop to add a number of employees)".

Am I close Gaet?

If so, ignoring the debate about whether you are actually going about this
right in the first place, I think what you want to do is add redirect=true
to your editNextEmployee forward element.  The idea here being that when
you forward to editNextEmployee from your Action, the SAME request is
being used, and there is of course the ActionForm still in scope.  By
setting redirect=true, you are telling the BROWSER to redirect to it,
which should result in a new ActionForm in request scope being
instantiated.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, March 21, 2005 12:31 pm, Hubert Rabago said:
> My message didn't really include a "solution", since like I said, it's
> not clear to me what you're trying to do.  :)
>
> Hubert
>
> On Mon, 21 Mar 2005 18:23:36 +0100, Gaet <[EMAIL PROTECTED]> wrote:
>> Yes, I want to start a new cycle..but your solution seems to not
>> work
>>
>> regards,
>>
>> - Original Message -
>> From: "Hubert Rabago" <[EMAIL PROTECTED]>
>> To: "Struts Users Mailing List" 
>> Sent: Monday, March 21, 2005 5:59 PM
>> Subject: Re: How to clear ActionForm before calling
>> mapping.forward(...)???
>>
>> > It's not exactly clear what you're trying to do.  After your action
>> > executes, you just call the same action again.  With your forward path
>> > set to /employeeDetail.do?reqCode=edit, the same request will go
>> > through the same action, only this time there's an additional request
>> > parameter.
>> > Is it possible you meant to redirect to start a new request cycle?  If
>> > so, change your forward to:
>> >
>> > > > > > path="/employeeDetail.do?reqCode=edit" redirect="true"/>
>> >
>> > Hubert
>> >
>> > On Mon, 21 Mar 2005 17:50:22 +0100, Gaet <[EMAIL PROTECTED]> wrote:
>> > > Hello the list!
>> > >
>> > > I have an action-mapping with a forward action that recall the same
>> action
>> > > mapping in order to display other informations.
>> > > My problem is that my form is submitted and not cleared in my
>> > > mapping.forward("editNextEmployee")!!!
>> > >
>> > > How to clear my form before to call the mapping.forward?
>> > > Thanks
>> > >
>> > > Example of my struts-config.xml:
>> > >
>> > > > > > type="org.mycompany.EmployeeAction"
>> > > name="employeeForm"
>> > > validate="false"
>> > > parameter="reqCode"
>> > > scope="request">
>> > > 
>> > > 
>> > > > > > path="/employeeDetail.do?reqCode=edit"/>
>> > > 
>> > >
>> >
>> > -
>> > 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]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to clear ActionForm before calling mapping.forward(...)???

2005-03-21 Thread Mark Shifman
You could request.removeAttribute("employeeForm")
before the forward and a new actionForm would be made on the next round.
Gaet wrote:
Hello the list!
I have an action-mapping with a forward action that recall the same action
mapping in order to display other informations.
My problem is that my form is submitted and not cleared in my
mapping.forward("editNextEmployee")!!!
How to clear my form before to call the mapping.forward?
Thanks
Example of my struts-config.xml:

   
   
   


- Original Message - 
From: "zw" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, March 17, 2005 7:33 AM
Subject: Multiple Module Config with HTML Form

 

Hi,
I faced a problem when I use the multiple module
method with HTML
Frame.
Could someone facing the same problem help
I have 2 struts-config.xml files - one is main, the
other is in the
module /web/menu ...
the one in /web/menu module looks like :

   
 

   
I am trying to display a screen with 2 frames - the
menu page (jsp page
with Struts Tags) and the content page (dummy page
that contains just
HTML)
I have the line 
in the menu
page.
I keep having the error - Cannot retrieve mapping for
action ... as
shown below...
I have tried displaying the menu page without the
frame, my menu is
generated without error.
2005-03-17 12:16:26 StandardWrapperValve[jsp]:
Servlet.service() for
servlet jsp threw exception
javax.servlet.jsp.JspException: Cannot retrieve
mapping for action
/MyAction
at
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:723)
at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:419)
at
org.apache.jsp.web.menu.menu_jsp._jspService(menu_jsp.java:114)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
   

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
98)
 

at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
   

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
 

at
   

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
 

at
   

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)
 

at
   

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
 

at
   

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 

at
   

org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:198)
 

at
   

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:152)
 

at
   

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
 

at
   

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 

at
   

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
)
 

at
   

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
 

at
   

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
)
 

at
   

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
 

at
   

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 

at
   

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
 

at
   

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
 

at
   

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 

at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
at
   

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:702)
 

at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
at
   

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:644)
 

at java.lang.Thread.run(Thread.java:534)

TIA.
__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-
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]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to clear ActionForm before calling mapping.forward(...)???

2005-03-21 Thread Hubert Rabago
My message didn't really include a "solution", since like I said, it's
not clear to me what you're trying to do.  :)

Hubert

On Mon, 21 Mar 2005 18:23:36 +0100, Gaet <[EMAIL PROTECTED]> wrote:
> Yes, I want to start a new cycle..but your solution seems to not work
> 
> regards,
> 
> - Original Message -
> From: "Hubert Rabago" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" 
> Sent: Monday, March 21, 2005 5:59 PM
> Subject: Re: How to clear ActionForm before calling mapping.forward(...)???
> 
> > It's not exactly clear what you're trying to do.  After your action
> > executes, you just call the same action again.  With your forward path
> > set to /employeeDetail.do?reqCode=edit, the same request will go
> > through the same action, only this time there's an additional request
> > parameter.
> > Is it possible you meant to redirect to start a new request cycle?  If
> > so, change your forward to:
> >
> > >  > > path="/employeeDetail.do?reqCode=edit" redirect="true"/>
> >
> > Hubert
> >
> > On Mon, 21 Mar 2005 17:50:22 +0100, Gaet <[EMAIL PROTECTED]> wrote:
> > > Hello the list!
> > >
> > > I have an action-mapping with a forward action that recall the same
> action
> > > mapping in order to display other informations.
> > > My problem is that my form is submitted and not cleared in my
> > > mapping.forward("editNextEmployee")!!!
> > >
> > > How to clear my form before to call the mapping.forward?
> > > Thanks
> > >
> > > Example of my struts-config.xml:
> > >
> > >  > > type="org.mycompany.EmployeeAction"
> > > name="employeeForm"
> > > validate="false"
> > > parameter="reqCode"
> > > scope="request">
> > > 
> > > 
> > >  > > path="/employeeDetail.do?reqCode=edit"/>
> > > 
> > >
> >
> > -
> > 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]



Re: How to clear ActionForm before calling mapping.forward(...)???

2005-03-21 Thread Gaet
Yes, I want to start a new cycle..but your solution seems to not work

regards,

- Original Message - 
From: "Hubert Rabago" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Monday, March 21, 2005 5:59 PM
Subject: Re: How to clear ActionForm before calling mapping.forward(...)???


> It's not exactly clear what you're trying to do.  After your action
> executes, you just call the same action again.  With your forward path
> set to /employeeDetail.do?reqCode=edit, the same request will go
> through the same action, only this time there's an additional request
> parameter.
> Is it possible you meant to redirect to start a new request cycle?  If
> so, change your forward to:
>
> >  > path="/employeeDetail.do?reqCode=edit" redirect="true"/>
>
> Hubert
>
> On Mon, 21 Mar 2005 17:50:22 +0100, Gaet <[EMAIL PROTECTED]> wrote:
> > Hello the list!
> >
> > I have an action-mapping with a forward action that recall the same
action
> > mapping in order to display other informations.
> > My problem is that my form is submitted and not cleared in my
> > mapping.forward("editNextEmployee")!!!
> >
> > How to clear my form before to call the mapping.forward?
> > Thanks
> >
> > Example of my struts-config.xml:
> >
> >  > type="org.mycompany.EmployeeAction"
> > name="employeeForm"
> > validate="false"
> > parameter="reqCode"
> > scope="request">
> > 
> > 
> >  > path="/employeeDetail.do?reqCode=edit"/>
> > 
> >
>
> -
> 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]



Re: How to clear ActionForm before calling mapping.forward(...)???

2005-03-21 Thread Hubert Rabago
It's not exactly clear what you're trying to do.  After your action
executes, you just call the same action again.  With your forward path
set to /employeeDetail.do?reqCode=edit, the same request will go
through the same action, only this time there's an additional request
parameter.
Is it possible you meant to redirect to start a new request cycle?  If
so, change your forward to:

>  path="/employeeDetail.do?reqCode=edit" redirect="true"/>

Hubert

On Mon, 21 Mar 2005 17:50:22 +0100, Gaet <[EMAIL PROTECTED]> wrote:
> Hello the list!
> 
> I have an action-mapping with a forward action that recall the same action
> mapping in order to display other informations.
> My problem is that my form is submitted and not cleared in my
> mapping.forward("editNextEmployee")!!!
> 
> How to clear my form before to call the mapping.forward?
> Thanks
> 
> Example of my struts-config.xml:
> 
>  type="org.mycompany.EmployeeAction"
> name="employeeForm"
> validate="false"
> parameter="reqCode"
> scope="request">
> 
> 
>  path="/employeeDetail.do?reqCode=edit"/>
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to clear ActionForm before calling mapping.forward(...)???

2005-03-21 Thread Gaet
Hello the list!

I have an action-mapping with a forward action that recall the same action
mapping in order to display other informations.
My problem is that my form is submitted and not cleared in my
mapping.forward("editNextEmployee")!!!

How to clear my form before to call the mapping.forward?
Thanks


Example of my struts-config.xml:









- Original Message - 
From: "zw" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, March 17, 2005 7:33 AM
Subject: Multiple Module Config with HTML Form


> Hi,
>
> I faced a problem when I use the multiple module
> method with HTML
> Frame.
> Could someone facing the same problem help
>
> I have 2 struts-config.xml files - one is main, the
> other is in the
> module /web/menu ...
>
> the one in /web/menu module looks like :
>
>  type="org.apache.struts.action.ActionMapping">
>  type="com..actions.MyAction"
>  name="MenuForm" scope="request"
> validate="false">
>module="/web/menu"
> path="/mainframe.jsp" />
>  
> 
>
> I am trying to display a screen with 2 frames - the
> menu page (jsp page
> with Struts Tags) and the content page (dummy page
> that contains just
> HTML)
>
> I have the line 
> in the menu
> page.
>
>
> I keep having the error - Cannot retrieve mapping for
> action ... as
> shown below...
>
> I have tried displaying the menu page without the
> frame, my menu is
> generated without error.
>
>
> 2005-03-17 12:16:26 StandardWrapperValve[jsp]:
> Servlet.service() for
> servlet jsp threw exception
> javax.servlet.jsp.JspException: Cannot retrieve
> mapping for action
> /MyAction
>  at
> org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:723)
>  at
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:419)
>  at
> org.apache.jsp.web.menu.menu_jsp._jspService(menu_jsp.java:114)
>  at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
>  at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>  at
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
98)
>  at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
>  at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
>  at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>  at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
>  at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
>  at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)
>  at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
>  at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>  at
>
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:198)
>  at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:152)
>  at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
>  at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>  at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
)
>  at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
>  at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
)
>  at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
>  at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>  at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
>  at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
>  at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>  at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
>  at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
>  at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
>  at
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:702)
>  at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
>  at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:644)
>  at java.lang.Thread.run(Thread.java:534)
>
>
>
> TIA.
>
>
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> -
> 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]