You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by François Richard <fr...@sofice.fr> on 2003/12/22 15:28:13 UTC

Synchronise Collection with ActionForm

Merry Christmas,

I have got an ActionForm with a collection.
The first synchronization (ActionForm object > form html) works great, on page load.
but, on form submitting, the second synchronization (form html > ActionForm object)doesn't work. the old values are still present.

The ActionForm (SocieteForm) object is stocked in the session.

my jsp :

<html:form action="societeValid">
<logic:iterate id="societe" name="societeForm" property="societes" scope="session" indexId="index">
<html:text name="societe" property="code" indexed="true" />
<html:text name="societe" property="raisonSociale" indexed="true" />
</logic:iterate>
</html:form>

Thanks,

François



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


RE: Generic Error Handler

Posted by Robert Taylor <rt...@mulework.com>.
Matthew,

What we do is define this in our web.xml file so that when the container
gets a 500, 404, etc... error status code, I can then assign the appropriate
Struts action to handle it. For example:

<error-page>
        <error-code>500</error-code>
        <location>/c/systemError</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/c/fileNotFoundError</location>
</error-page>

For application exceptions that occur in an action class, you
could (as you have already mentioned) defined some general
global exceptions handlers and then define more fine grained
exception handlers as necessary (per action).

hth,

robert

> -----Original Message-----
> From: Matthew J. Vincent [mailto:vincent@cs.usm.maine.edu]
> Sent: Monday, January 12, 2004 11:08 AM
> To: Struts Users Mailing List
> Subject: Generic Error Handler
>
>
> I searched the archives and I must have missed it.  I want to
> have a generic
> JSP or Servlet get invoked when an error occurs in my application.  For
> example, when I try to clink on a link on one of my pages I get an error
> message:
>
> HTTP Status 500 - No action instance for path /detailSearch could
> be created
>
> Looking at the logs it is obvious why there is an error (because I didn't
> create the org.jax.mgi.mtb.wi.actions.DetailSearchAction class).  What is
> the best approach to handle this type of error?  I tried adding the
> following to my struts-config.xml, but it is not going to the appError.jsp
> page.
>
>    <global-exceptions>
>      <exception key="system.error"
>                 type="java.lang.Exception"
>                 path="/appError.jsp"/>
>
>      <exception key="system.error"
>                 type="java.lang.ClassNotFoundException"
>                 path="/appError.jsp"/>
>
>    </global-exceptions>
>
> What is the best way to handle this?  What about other types of
> errors?  Is
> there a rule of thumb that everyone follows?
>
> Sorry for the hopefully easy (probably already asked) question.
>
> Matt
>
>
> Here is an output of the logs:
>
> SEVERE: No action instance for path /detailSearch could be created
> java.lang.ClassNotFoundException:
> org.jax.mgi.mtb.wi.actions.DetailSearchAction
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClass
> Loader.jav
> a:1366)
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClass
> Loader.jav
> a:1213)
>         at
> org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.
> java:207)
>         at
> org.apache.struts.util.RequestUtils.applicationInstance(RequestUti
> ls.java:23
> 1)
>         at
> org.apache.struts.action.RequestProcessor.processActionCreate(Requ
> estProcess
> or.java:326)
>         at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor
> .java:268)
>         at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>         at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(A
> pplication
> FilterChain.j
> ava:284)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicati
> onFilterCh
> ain.java:204)
>
>         at
> org.jax.mgi.mtb.wi.filters.TimerFilter.doFilter(TimerFilter.java:23)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(A
> pplication
> FilterChain.j
> ava:233)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicati
> onFilterCh
> ain.java:204)
>
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapp
> erValve.ja
> va:256)
>         at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardV
> alveContex
> t.java:151)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:564)
>         at
> org.apache.catalina.core.StandardContextValve.invokeInternal(Stand
> ardContext
> Valve.java:24
> 5)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardConte
> xtValve.ja
> va:199)
>         at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardV
> alveContex
> t.java:151)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:564)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValv
> e.java:195
> )
>         at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardV
> alveContex
> t.java:151)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValv
> e.java:164
> )
>         at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardV
> alveContex
> t.java:149)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:564)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngine
> Valve.java
> :156)
>         at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardV
> alveContex
> t.java:151)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:564)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
>         at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.pr
> ocessConne
> ction(Http11P
> rotocol.java:696)
>         at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Thre
> adPool.jav
> a:677)
>         at java.lang.Thread.run(Thread.java:534)
>
>
>
> ---------------------------------------------------------------------
> 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


RE: Generic Error Handler

Posted by "Matthew J. Vincent" <vi...@cs.usm.maine.edu>.
Would this be better handled in the web.xml????

Matt

-----Original Message-----
From: Matthew J. Vincent [mailto:vincent@cs.usm.maine.edu]
Sent: Monday, January 12, 2004 11:08 AM
To: Struts Users Mailing List
Subject: Generic Error Handler


I searched the archives and I must have missed it.  I want to have a generic
JSP or Servlet get invoked when an error occurs in my application.  For
example, when I try to clink on a link on one of my pages I get an error
message:

HTTP Status 500 - No action instance for path /detailSearch could be created

Looking at the logs it is obvious why there is an error (because I didn't
create the org.jax.mgi.mtb.wi.actions.DetailSearchAction class).  What is
the best approach to handle this type of error?  I tried adding the
following to my struts-config.xml, but it is not going to the appError.jsp
page.

   <global-exceptions>
     <exception key="system.error"
                type="java.lang.Exception"
                path="/appError.jsp"/>

     <exception key="system.error"
                type="java.lang.ClassNotFoundException"
                path="/appError.jsp"/>

   </global-exceptions>

What is the best way to handle this?  What about other types of errors?  Is
there a rule of thumb that everyone follows?

Sorry for the hopefully easy (probably already asked) question.

Matt


Here is an output of the logs:

SEVERE: No action instance for path /detailSearch could be created
java.lang.ClassNotFoundException:
org.jax.mgi.mtb.wi.actions.DetailSearchAction
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1366)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1213)
        at
org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:207)
        at
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:23
1)
        at
org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcess
or.java:326)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:268)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.j
ava:284)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:204)

        at
org.jax.mgi.mtb.wi.filters.TimerFilter.doFilter(TimerFilter.java:23)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.j
ava:233)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:204)

        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:24
5)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:199)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195
)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164
)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:149)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:156)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11P
rotocol.java:696)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:677)
        at java.lang.Thread.run(Thread.java:534)



---------------------------------------------------------------------
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


RE: Generic Error Handler

Posted by Norm Deane <no...@vanderbilt.edu>.
We generally map HTTP 400, 500, and 404 to an error handler action via the
web.xml like so...

    <error-page>
        <error-code>500</error-code>
        <location>/Error.do</location>
    </error-page>

    <error-page>
        <error-code>404</error-code>
        <location>/InvalidUrl.do</location>
    </error-page>

    <error-page>
        <error-code>400</error-code>
        <location>/InvalidUrl.do</location>
    </error-page>

--Norm

-- 
Norm Deane
MIS Consultant
Vanderbilt University
(615) 322-7855
norm.deane@vanderbilt.edu 

> -----Original Message-----
> From: Matthew J. Vincent [mailto:vincent@cs.usm.maine.edu] 
> Sent: Monday, January 12, 2004 10:08 AM
> To: Struts Users Mailing List
> Subject: Generic Error Handler
> 
> 
> I searched the archives and I must have missed it.  I want to 
> have a generic JSP or Servlet get invoked when an error 
> occurs in my application.  For example, when I try to clink 
> on a link on one of my pages I get an error
> message:
> 
> HTTP Status 500 - No action instance for path /detailSearch 
> could be created
> 
> Looking at the logs it is obvious why there is an error 
> (because I didn't create the 
> org.jax.mgi.mtb.wi.actions.DetailSearchAction class).  What 
> is the best approach to handle this type of error?  I tried 
> adding the following to my struts-config.xml, but it is not 
> going to the appError.jsp page.
> 
>    <global-exceptions>
>      <exception key="system.error"
>                 type="java.lang.Exception"
>                 path="/appError.jsp"/>
> 
>      <exception key="system.error"
>                 type="java.lang.ClassNotFoundException"
>                 path="/appError.jsp"/>
> 
>    </global-exceptions>
> 
> What is the best way to handle this?  What about other types 
> of errors?  Is there a rule of thumb that everyone follows?
> 
> Sorry for the hopefully easy (probably already asked) question.
> 
> Matt
> 
> 
> Here is an output of the logs:
> 
> SEVERE: No action instance for path /detailSearch could be created
> java.lang.ClassNotFoundException: 
> org.jax.mgi.mtb.wi.actions.DetailSearchAction
>         at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappC
> lassLoader.jav
> a:1366)
>         at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappC
> lassLoader.jav
> a:1213)
>         at
> org.apache.struts.util.RequestUtils.applicationClass(RequestUt
> ils.java:207)
>         at 
> org.apache.struts.util.RequestUtils.applicationInstance(Reques
> tUtils.java:23
> 1)
>         at 
> org.apache.struts.action.RequestProcessor.processActionCreate(
> RequestProcess
> or.java:326)
>         at
> org.apache.struts.action.RequestProcessor.process(RequestProce
> ssor.java:268)
>         at
> org.apache.struts.action.ActionServlet.process(ActionServlet.j
> ava:1482)
>         at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>         at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(Application
> FilterChain.j
> ava:284)
>         at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterCh
> ain.java:204)
> 
>         at
> org.jax.mgi.mtb.wi.filters.TimerFilter.doFilter(TimerFilter.java:23)
>         at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(Application
> FilterChain.j
> ava:233)
>         at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterCh
> ain.java:204)
> 
>         at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.ja
> va:256)
>         at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContex
> t.java:151)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:564)
>         at 
> org.apache.catalina.core.StandardContextValve.invokeInternal(S
> tandardContext
> Valve.java:24
> 5)
>         at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.ja
> va:199)
>         at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContex
> t.java:151)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:564)
>         at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:195
> )
>         at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContex
> t.java:151)
>         at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:164
> )
>         at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContex
> t.java:149)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:564)
>         at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java
> :156)
>         at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContex
> t.java:151)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:564)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
>         at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.
> java:211)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Process
> or.java:805)
>         at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
> r.processConne
> ction(Http11P
> rotocol.java:696)
>         at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi
> nt.java:605)
>         at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.jav
> a:677)
>         at java.lang.Thread.run(Thread.java:534)
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Generic Error Handler

Posted by "Matthew J. Vincent" <vi...@cs.usm.maine.edu>.
I searched the archives and I must have missed it.  I want to have a generic
JSP or Servlet get invoked when an error occurs in my application.  For
example, when I try to clink on a link on one of my pages I get an error
message:

HTTP Status 500 - No action instance for path /detailSearch could be created

Looking at the logs it is obvious why there is an error (because I didn't
create the org.jax.mgi.mtb.wi.actions.DetailSearchAction class).  What is
the best approach to handle this type of error?  I tried adding the
following to my struts-config.xml, but it is not going to the appError.jsp
page.

   <global-exceptions>
     <exception key="system.error"
                type="java.lang.Exception"
                path="/appError.jsp"/>

     <exception key="system.error"
                type="java.lang.ClassNotFoundException"
                path="/appError.jsp"/>

   </global-exceptions>

What is the best way to handle this?  What about other types of errors?  Is
there a rule of thumb that everyone follows?

Sorry for the hopefully easy (probably already asked) question.

Matt


Here is an output of the logs:

SEVERE: No action instance for path /detailSearch could be created
java.lang.ClassNotFoundException:
org.jax.mgi.mtb.wi.actions.DetailSearchAction
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1366)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1213)
        at
org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:207)
        at
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:23
1)
        at
org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcess
or.java:326)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:268)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.j
ava:284)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:204)

        at
org.jax.mgi.mtb.wi.filters.TimerFilter.doFilter(TimerFilter.java:23)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.j
ava:233)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:204)

        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:24
5)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:199)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195
)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164
)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:149)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:156)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11P
rotocol.java:696)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:677)
        at java.lang.Thread.run(Thread.java:534)



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


Re: Synchronise Collection with ActionForm

Posted by François Richard <fr...@sofice.fr>.
there are 2 actions and one jsp, one action to load the page (list of 
society) from the database and the other to submit changes (creation, 
modification and suppression). In all circumstances (error or not) the 
user returns to the list of society (via the action).
Note : the synchro works fine for all the objects in the ActionForm 
(SocieteForm) expects for the ArrayList (only form > object)

the action class(submit)

public class SocieteValidAction extends Action {
    public ActionForward execute(ActionMapping mapping, ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response)
     throws IOException, ServletException,
            ClassNotFoundException, SQLException
    {
        ActionErrors errors = new ActionErrors();
        SocieteForm societeForm = (SocieteForm)form;
       // updating database
        // .....
        if (!errors.isEmpty()) saveErrors(request, errors);
        return (mapping.findForward("success"));

    }
}


Richard Yee wrote:

>François,
>Show us your Action class. From your struts_config, it
>seems like you are in al loop in that you forward to
>the same action that is your input. How does the user
>ever get past this action?
>
>-Richard
>
>--- François_Richard <fr...@sofice.fr> wrote:
>  
>
>>no one have an idea !!
>>
>>my ActionForm :
>>
>>public class SocieteForm extends ActionForm {
>>   
>>    private ArrayList societes;
>>
>>    public ActionErrors validate(ActionMapping
>>mapping, 
>>HttpServletRequest request) {
>>        ActionErrors errors = new ActionErrors();
>>       return errors;
>>    }
>>
>>    public ArrayList getSocietes()   {  return
>>societes;   }
>>    public void setSocietes(ArrayList liste)    {
>>societes = liste;  }
>>}
>>
>>my struts-config.xml (only for submit) :
>>
>>        <action
>>            attribute="societeForm"
>>            name="societeForm"
>>            path="/societeValid"
>>            scope="session"
>>           
>>type="com.sofice.cra.action.SocieteValidAction"
>>            validate="true"
>>            input="/lstSocietes.do">
>>            <forward name="success"
>>path="/lstSocietes.do" />
>>        </action>
>>
>>any advice would be appreciated. ;-)
>>
>>François
>>
>>
>>
>>François Richard wrote:
>>
>>    
>>
>>>Merry Christmas,
>>>
>>>I have got an ActionForm with a collection.
>>>The first synchronization (ActionForm object >
>>>      
>>>
>>form html) works great, 
>>    
>>
>>>on page load.
>>>but, on form submitting, the second
>>>      
>>>
>>synchronization (form html > 
>>    
>>
>>>ActionForm object)doesn't work. the old values are
>>>      
>>>
>>still present.
>>    
>>
>>>The ActionForm (SocieteForm) object is stocked in
>>>      
>>>
>>the session.
>>    
>>
>>>my jsp :
>>>
>>><html:form action="societeValid">
>>><logic:iterate id="societe" name="societeForm"
>>>      
>>>
>>property="societes" 
>>    
>>
>>>scope="session" indexId="index">
>>><html:text name="societe" property="code"
>>>      
>>>
>>indexed="true" />
>>    
>>
>>><html:text name="societe" property="raisonSociale"
>>>      
>>>
>>indexed="true" />
>>    
>>
>>></logic:iterate>
>>></html:form>
>>>
>>>Thanks,
>>>
>>>François
>>>
>>>
>>>
>>>
>>>      
>>>
>---------------------------------------------------------------------
>  
>
>>>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!?
>New Yahoo! Photos - easier uploading and sharing.
>http://photos.yahoo.com/
>
>---------------------------------------------------------------------
>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


Re: Synchronise Collection with ActionForm

Posted by Richard Yee <ry...@yahoo.com>.
Fran�ois,
Show us your Action class. From your struts_config, it
seems like you are in al loop in that you forward to
the same action that is your input. How does the user
ever get past this action?

-Richard

--- Fran�ois_Richard <fr...@sofice.fr> wrote:
> no one have an idea !!
> 
> my ActionForm :
> 
> public class SocieteForm extends ActionForm {
>    
>     private ArrayList societes;
> 
>     public ActionErrors validate(ActionMapping
> mapping, 
> HttpServletRequest request) {
>         ActionErrors errors = new ActionErrors();
>        return errors;
>     }
> 
>     public ArrayList getSocietes()   {  return
> societes;   }
>     public void setSocietes(ArrayList liste)    {
> societes = liste;  }
> }
> 
> my struts-config.xml (only for submit) :
> 
>         <action
>             attribute="societeForm"
>             name="societeForm"
>             path="/societeValid"
>             scope="session"
>            
> type="com.sofice.cra.action.SocieteValidAction"
>             validate="true"
>             input="/lstSocietes.do">
>             <forward name="success"
> path="/lstSocietes.do" />
>         </action>
> 
> any advice would be appreciated. ;-)
> 
> Fran�ois
> 
> 
> 
> Fran�ois Richard wrote:
> 
> > Merry Christmas,
> >
> > I have got an ActionForm with a collection.
> > The first synchronization (ActionForm object >
> form html) works great, 
> > on page load.
> > but, on form submitting, the second
> synchronization (form html > 
> > ActionForm object)doesn't work. the old values are
> still present.
> >
> > The ActionForm (SocieteForm) object is stocked in
> the session.
> >
> > my jsp :
> >
> > <html:form action="societeValid">
> > <logic:iterate id="societe" name="societeForm"
> property="societes" 
> > scope="session" indexId="index">
> > <html:text name="societe" property="code"
> indexed="true" />
> > <html:text name="societe" property="raisonSociale"
> indexed="true" />
> > </logic:iterate>
> > </html:form>
> >
> > Thanks,
> >
> > Fran�ois
> >
> >
> >
> >
>
---------------------------------------------------------------------
> > 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!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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


Getting values from jsp pages

Posted by Kamal Gupta <kg...@tech-group.co.uk>.
Hi,

Can some one please send me some example code of getting values from a jsp
page as I have to insert the values into the database.

what are the different steps which are required to be done in struts to make
this work

Regards

Kamal

-----Original Message-----
From: François Richard [mailto:frichard@sofice.fr]
Sent: 23 December 2003 09:03
To: Struts Users Mailing List
Subject: Re: Synchronise Collection with ActionForm


no one have an idea !!

my ActionForm :

public class SocieteForm extends ActionForm {

    private ArrayList societes;

    public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
       return errors;
    }

    public ArrayList getSocietes()   {  return societes;   }
    public void setSocietes(ArrayList liste)    { societes = liste;  }
}

my struts-config.xml (only for submit) :

        <action
            attribute="societeForm"
            name="societeForm"
            path="/societeValid"
            scope="session"
            type="com.sofice.cra.action.SocieteValidAction"
            validate="true"
            input="/lstSocietes.do">
            <forward name="success" path="/lstSocietes.do" />
        </action>

any advice would be appreciated. ;-)

François



François Richard wrote:

> Merry Christmas,
>
> I have got an ActionForm with a collection.
> The first synchronization (ActionForm object > form html) works great,
> on page load.
> but, on form submitting, the second synchronization (form html >
> ActionForm object)doesn't work. the old values are still present.
>
> The ActionForm (SocieteForm) object is stocked in the session.
>
> my jsp :
>
> <html:form action="societeValid">
> <logic:iterate id="societe" name="societeForm" property="societes"
> scope="session" indexId="index">
> <html:text name="societe" property="code" indexed="true" />
> <html:text name="societe" property="raisonSociale" indexed="true" />
> </logic:iterate>
> </html:form>
>
> Thanks,
>
> François
>
>
>
> ---------------------------------------------------------------------
> 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


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


Re: Synchronise Collection with ActionForm

Posted by François Richard <fr...@sofice.fr>.
no one have an idea !!

my ActionForm :

public class SocieteForm extends ActionForm {
   
    private ArrayList societes;

    public ActionErrors validate(ActionMapping mapping, 
HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
       return errors;
    }

    public ArrayList getSocietes()   {  return societes;   }
    public void setSocietes(ArrayList liste)    { societes = liste;  }
}

my struts-config.xml (only for submit) :

        <action
            attribute="societeForm"
            name="societeForm"
            path="/societeValid"
            scope="session"
            type="com.sofice.cra.action.SocieteValidAction"
            validate="true"
            input="/lstSocietes.do">
            <forward name="success" path="/lstSocietes.do" />
        </action>

any advice would be appreciated. ;-)

François



François Richard wrote:

> Merry Christmas,
>
> I have got an ActionForm with a collection.
> The first synchronization (ActionForm object > form html) works great, 
> on page load.
> but, on form submitting, the second synchronization (form html > 
> ActionForm object)doesn't work. the old values are still present.
>
> The ActionForm (SocieteForm) object is stocked in the session.
>
> my jsp :
>
> <html:form action="societeValid">
> <logic:iterate id="societe" name="societeForm" property="societes" 
> scope="session" indexId="index">
> <html:text name="societe" property="code" indexed="true" />
> <html:text name="societe" property="raisonSociale" indexed="true" />
> </logic:iterate>
> </html:form>
>
> Thanks,
>
> François
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Synchronise Collection with ActionForm

Posted by François Richard <fr...@sofice.fr>.
the solution :
in the <logic:iterate> the "id" must be choosen carefully ... you have 
to use the same value as "property"
I found the explanation here (/Indexed References/) :
http://jakarta.apache.org/struts/api/org/apache/struts/taglib/bean/package-summary.html#doc.Properties

for me :
<html:form action="societeValid">
<logic:iterate id="societes" name="societeForm" property="societes" 
scope="session" indexId="index">
<html:text name="societes" property="code" indexed="true" />
<html:text name="societes" property="raisonSociale" indexed="true" />
</logic:iterate>
</html:form>

François Richard wrote:

> Merry Christmas,
>
> I have got an ActionForm with a collection.
> The first synchronization (ActionForm object > form html) works great, 
> on page load.
> but, on form submitting, the second synchronization (form html > 
> ActionForm object)doesn't work. the old values are still present.
>
> The ActionForm (SocieteForm) object is stocked in the session.
>
> my jsp :
>
> <html:form action="societeValid">
> <logic:iterate id="societe" name="societeForm" property="societes" 
> scope="session" indexId="index">
> <html:text name="societe" property="code" indexed="true" />
> <html:text name="societe" property="raisonSociale" indexed="true" />
> </logic:iterate>
> </html:form>
>
> Thanks,
>
> François
>
>
>
> ---------------------------------------------------------------------
> 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