You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by aum strut <au...@gmail.com> on 2008/10/07 18:56:24 UTC

Struts2 Data Transfer

Hi All,

Sorry if i am asking a very basic question.

i need to transfer data from the user registration page to the java beans to
be used for inserting values in the data base.
i have created two seperate beans for this
1) for storing user address field and second is for storing user login
information.

i want that when user cllick on the REgister button these two Beans get
filled with the respective  values from the UI. i have named the
corresponding fields in the beans with respect to the fields name in the UI.

currently i am using struts 2.0.11

how can i fill these two beans at a same time so that my action class can
use these two beans classes for the registration Logic.

i have the idea of using ModelDriven Action but how can intianilised these
two beans at same time any pointer in this regard will be much appriciated.

Thanks in advance
-aum

Re: Struts2 Data Transfer

Posted by aum strut <au...@gmail.com>.
i even made getter and setter method for one of my beans namely Person

but when i am using these getter /setter method in the action calss for the
beans i am getting exception while the GetModel()

i mean the model driven approach is working fine..

On Thu, Oct 9, 2008 at 1:16 PM, aum strut <au...@gmail.com> wrote:

>  Yes Dave , There is a sigle form(Page) for this with different sections
> in it for registration.i only want that the data from this single page
> should go to different (2 in my case) beans depends upon the fields i have
> defined in the respective beans.
>
>
> i tied this and is working fine but i want that i should seperate the
> getter and setter from my action
>
> i am using model driven approach and it is filling one beans accurately but
> i can not fill the second beans in the same getModel() .
>
> any other approach so that i can fill thm at the same time once my action
> get called .
>
>   On Thu, Oct 9, 2008 at 3:46 AM, Laurie Harper <la...@holoweb.net>wrote:
>
>> Just do what Dave outlined in his previous reply. You need getter/setters
>> in your action for each bean ([gs]etBean1(), [gs]etBean2() to correspond
>> with Dave's JSP sample code) and everything should work. Have you tried it?
>>
>> L.
>>
>>
>> aum strut wrote:
>>
>>> the issue is i have a registration from in the UI  which have two
>>> different
>>> section in a single page.
>>>
>>> 1) User login Information
>>> 2)Address Information
>>>
>>> i want that these two sections should get populated in two different Bean
>>> by
>>> the interceptor
>>> that mean User login fields get Pouplated in the UserLogin Beans while
>>> the
>>> Address section should  get populated in the Address Bean when my
>>> Registration Action get called once user will hit the Register Button.
>>>
>>>
>>> Thanks
>>> -aum
>>>
>>>
>>> On Tue, Oct 7, 2008 at 10:59 PM, Dave Newton <ne...@yahoo.com>
>>> wrote:
>>>
>>> --- On Tue, 10/7/08, aum strut wrote:
>>>>
>>>>> i need to transfer data from the user registration page to
>>>>> the java beans to be used for inserting values in the data base.
>>>>> i have created two seperate beans for this 1) for storing user
>>>>> address field and second is for storing user login information.
>>>>>
>>>>> i want that when user cllick on the REgister button these
>>>>> two Beans get filled with the respective  values from the UI.
>>>>> i have named the corresponding fields in the beans with respect
>>>>> to the fields name in the UI.
>>>>>
>>>> What, precisely, is the issue?
>>>>
>>>> If you have a form containing:
>>>>
>>>> <s:textfield name="bean1.aField"/>
>>>> <s:textfield name="bean2.anotherField"/>
>>>>
>>>> each bean will contain whatever was entered in the form.
>>>>
>>>> Dave
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>

Re: Struts2 Data Transfer

Posted by aum strut <au...@gmail.com>.
thats true but the probelm is when i am trying to return my custom bean from
the getModel()
method..

and i am unable to find out the exact cause why it is occuring there

On Thu, Oct 9, 2008 at 11:25 PM, Jim Kiley <jh...@summa-tech.com> wrote:

> The error is complaining that you have no result defined for the result
> named "input".  That probably means that the Action is encountering a
> validation error or the like, causing it to return "input".
>
> On Thu, Oct 9, 2008 at 1:21 PM, aum strut <au...@gmail.com> wrote:
>
> > Hi All,
> >
> > i tried to follow the the way suggested by Laurie i followed the below
> > mentioned practice.
> >
> > 1) I have two beans which i want to fill at the same time when the user
> hit
> > the registration button after filling the form.
> >
> > 2) in my action calss i am using the model driven approach to fill the
> two
> > beans using getMOdel() method
> >
> > 3) For this i creaded another beans with the getter and setter for thse
> two
> > above mentioed beans
> >
> > below is the code i have written in my REgister  Action class
> >
> >
> > *
> >
> > public* *class* UserRegistrationAction *extends* ActionSupport
> > *implements*ModelDriven<RegisterBean> {
> >
> > /**
> >
> > *
> >
> > */
> >
> > *private* *static* *final* *long* *serialVersionUID* = 1L;
> >
> >  *public* String execute() *throws* Exception{
> >
> >  *return* *SUCCESS*;
> >
> > }
> >
> > *private* RegisterBean registerBean=*new* RegisterBean();
> >
> >
> >
> > *public* RegisterBean getModel() {
> >
> > *return* registerBean;
> >
> > }
> >
> >
> >
> >  }
> > but i am getting the below mentoed exception in the console which is
> saying
> > that i have not configured the system if the resulkt type is input
> >
> > *but if i will remove* "*return* registerBean;" line from my
> > *getModel()*and "
> > *return* registerBean;""*return* null;"* the exception will no longer be
> > there*
> >
> >
> > can anybody suggest me where i am wrong???
> >
> > SEVERE: Could not find action or result
> >
> > No result defined for action
> > com.dograpress.raisonne.registration.UserRegistrationAction and result
> > input
> > - action -
> >
> >
> file:/F:/EclipseProjects/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/DograPress/WEB-INF/classes/struts-UserRegistration.xml:6:105
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(*
> > DefaultActionInvocation.java:350*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:253*)
> >
> > at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(*
> > ValidationInterceptor.java:150*)
> >
> > at
> >
> >
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(
> > *AnnotationValidationInterceptor.java:48*)
> >
> > at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(*
> > MethodFilterInterceptor.java:86*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at
> > com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(
> > *ConversionErrorInterceptor.java:123*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(*
> > ParametersInterceptor.java:186*)
> >
> > at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(*
> > MethodFilterInterceptor.java:86*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at
> >
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(*
> > StaticParametersInterceptor.java:105*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(*
> > CheckboxInterceptor.java:83*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(*
> > FileUploadInterceptor.java:207*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(*
> > ModelDrivenInterceptor.java:74*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at
> >
> >
> com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(*
> > ScopedModelDrivenInterceptor.java:127*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at
> > org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(*
> > ProfilingActivationInterceptor.java:107*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at
> > org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(*
> > DebuggingInterceptor.java:206*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(*
> > ChainingInterceptor.java:115*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(*
> > I18nInterceptor.java:143*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(*
> > PrepareInterceptor.java:121*)
> >
> > at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(*
> > MethodFilterInterceptor.java:86*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(*
> > ServletConfigInterceptor.java:170*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(*
> > AliasInterceptor.java:123*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at
> >
> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(*
> > ExceptionMappingInterceptor.java:176*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:224*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> > DefaultActionInvocation.java:223*)
> >
> > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> > UtilTimerStack.java:455*)
> >
> > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> > DefaultActionInvocation.java:221*)
> >
> > at org.apache.struts2.impl.StrutsActionProxy.execute(*
> > StrutsActionProxy.java:50*)
> >
> > at org.apache.struts2.dispatcher.Dispatcher.serviceAction(*
> > Dispatcher.java:504*)
> >
> > at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(*
> > FilterDispatcher.java:419*)
> >
> > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
> > ApplicationFilterChain.java:235*)
> >
> > at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
> > ApplicationFilterChain.java:206*)
> >
> > at org.apache.catalina.core.StandardWrapperValve.invoke(*
> > StandardWrapperValve.java:230*)
> >
> > at org.apache.catalina.core.StandardContextValve.invoke(*
> > StandardContextValve.java:175*)
> >
> > at org.apache.catalina.core.StandardHostValve.invoke(*
> > StandardHostValve.java:128*)
> >
> > at org.apache.catalina.valves.ErrorReportValve.invoke(*
> > ErrorReportValve.java:104*)
> >
> > at org.apache.catalina.core.StandardEngineValve.invoke(*
> > StandardEngineValve.java:109*)
> >
> > at org.apache.catalina.connector.CoyoteAdapter.service(*
> > CoyoteAdapter.java:261*)
> >
> > at org.apache.coyote.http11.Http11Processor.process(*
> > Http11Processor.java:844*)
> >
> > at
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(*
> > Http11Protocol.java:581*)
> >
> > at
> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(*JIoEndpoint.java:447*)
> >
> > at java.lang.Thread.run(Unknown Source)
> >
> >
> > On 10/9/08, aum strut <au...@gmail.com> wrote:
> > >
> > >  Thaks laurie
> > >
> > > this was exactly i was looking for...
> > > i will try this way and it seems to be a good way .
> > >
> > > Thanks for the help
> > >
> > >
> > >  On Thu, Oct 9, 2008 at 1:32 PM, Laurie Harper <la...@holoweb.net>
> > wrote:
> > >
> > >> You can't expose two different beans with one getModel() method, if
> > that's
> > >> what you're asking. You can, however, return a simple 'wrapper' bean
> > from
> > >> getModel() which has a getter/setter pair for each of your target
> beans.
> > >>
> > >> Either approach gives you a way to address the two beans
> independently,
> > >> either explicitly as in <action>.getBean1().setField1() on implicitly
> as
> > in
> > >> <action>.getModel().getBean1().setField1().
> > >>
> > >> L.
> > >>
> > >>
> > >> aum strut wrote:
> > >>
> > >>> Yes Dave , There is a sigle form(Page) for this with different
> sections
> > >>> in
> > >>> it for registration.i only want that the data from this single page
> > >>> should
> > >>> go to different (2 in my case) beans depends upon the fields i have
> > >>> defined
> > >>> in the respective beans.
> > >>>
> > >>>
> > >>> i tied this and is working fine but i want that i should seperate the
> > >>> getter
> > >>> and setter from my action
> > >>>
> > >>> i am using model driven approach and it is filling one beans
> accurately
> > >>> but
> > >>> i can not fill the second beans in the same getModel() .
> > >>>
> > >>> any other approach so that i can fill thm at the same time once my
> > action
> > >>> get called .
> > >>>
> > >>> On Thu, Oct 9, 2008 at 3:46 AM, Laurie Harper <la...@holoweb.net>
> > >>> wrote:
> > >>>
> > >>> Just do what Dave outlined in his previous reply. You need
> > getter/setters
> > >>>> in your action for each bean ([gs]etBean1(), [gs]etBean2() to
> > correspond
> > >>>> with Dave's JSP sample code) and everything should work. Have you
> > tried
> > >>>> it?
> > >>>>
> > >>>> L.
> > >>>>
> > >>>>
> > >>>> aum strut wrote:
> > >>>>
> > >>>> the issue is i have a registration from in the UI  which have two
> > >>>>> different
> > >>>>> section in a single page.
> > >>>>>
> > >>>>> 1) User login Information
> > >>>>> 2)Address Information
> > >>>>>
> > >>>>> i want that these two sections should get populated in two
> different
> > >>>>> Bean
> > >>>>> by
> > >>>>> the interceptor
> > >>>>> that mean User login fields get Pouplated in the UserLogin Beans
> > while
> > >>>>> the
> > >>>>> Address section should  get populated in the Address Bean when my
> > >>>>> Registration Action get called once user will hit the Register
> > Button.
> > >>>>>
> > >>>>>
> > >>>>> Thanks
> > >>>>> -aum
> > >>>>>
> > >>>>>
> > >>>>> On Tue, Oct 7, 2008 at 10:59 PM, Dave Newton <
> newton.dave@yahoo.com>
> > >>>>> wrote:
> > >>>>>
> > >>>>> --- On Tue, 10/7/08, aum strut wrote:
> > >>>>>
> > >>>>>> i need to transfer data from the user registration page to
> > >>>>>>> the java beans to be used for inserting values in the data base.
> > >>>>>>> i have created two seperate beans for this 1) for storing user
> > >>>>>>> address field and second is for storing user login information.
> > >>>>>>>
> > >>>>>>> i want that when user cllick on the REgister button these
> > >>>>>>> two Beans get filled with the respective  values from the UI.
> > >>>>>>> i have named the corresponding fields in the beans with respect
> > >>>>>>> to the fields name in the UI.
> > >>>>>>>
> > >>>>>>> What, precisely, is the issue?
> > >>>>>>
> > >>>>>> If you have a form containing:
> > >>>>>>
> > >>>>>> <s:textfield name="bean1.aField"/>
> > >>>>>> <s:textfield name="bean2.anotherField"/>
> > >>>>>>
> > >>>>>> each bean will contain whatever was entered in the form.
> > >>>>>>
> > >>>>>> Dave
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > ---------------------------------------------------------------------
> > >>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >>>>>> For additional commands, e-mail: user-help@struts.apache.org
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >>>> For additional commands, e-mail: user-help@struts.apache.org
> > >>>>
> > >>>>
> > >>>>
> > >>>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >> For additional commands, e-mail: user-help@struts.apache.org
> > >>
> > >>
> > >>
> > >
> > >
> >
>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>

Re: Struts2 Data Transfer

Posted by Jim Kiley <jh...@summa-tech.com>.
The error is complaining that you have no result defined for the result
named "input".  That probably means that the Action is encountering a
validation error or the like, causing it to return "input".

On Thu, Oct 9, 2008 at 1:21 PM, aum strut <au...@gmail.com> wrote:

> Hi All,
>
> i tried to follow the the way suggested by Laurie i followed the below
> mentioned practice.
>
> 1) I have two beans which i want to fill at the same time when the user hit
> the registration button after filling the form.
>
> 2) in my action calss i am using the model driven approach to fill the two
> beans using getMOdel() method
>
> 3) For this i creaded another beans with the getter and setter for thse two
> above mentioed beans
>
> below is the code i have written in my REgister  Action class
>
>
> *
>
> public* *class* UserRegistrationAction *extends* ActionSupport
> *implements*ModelDriven<RegisterBean> {
>
> /**
>
> *
>
> */
>
> *private* *static* *final* *long* *serialVersionUID* = 1L;
>
>  *public* String execute() *throws* Exception{
>
>  *return* *SUCCESS*;
>
> }
>
> *private* RegisterBean registerBean=*new* RegisterBean();
>
>
>
> *public* RegisterBean getModel() {
>
> *return* registerBean;
>
> }
>
>
>
>  }
> but i am getting the below mentoed exception in the console which is saying
> that i have not configured the system if the resulkt type is input
>
> *but if i will remove* "*return* registerBean;" line from my
> *getModel()*and "
> *return* registerBean;""*return* null;"* the exception will no longer be
> there*
>
>
> can anybody suggest me where i am wrong???
>
> SEVERE: Could not find action or result
>
> No result defined for action
> com.dograpress.raisonne.registration.UserRegistrationAction and result
> input
> - action -
>
> file:/F:/EclipseProjects/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/DograPress/WEB-INF/classes/struts-UserRegistration.xml:6:105
>
> at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(*
> DefaultActionInvocation.java:350*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:253*)
>
> at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(*
> ValidationInterceptor.java:150*)
>
> at
>
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(
> *AnnotationValidationInterceptor.java:48*)
>
> at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(*
> MethodFilterInterceptor.java:86*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at
> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(
> *ConversionErrorInterceptor.java:123*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(*
> ParametersInterceptor.java:186*)
>
> at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(*
> MethodFilterInterceptor.java:86*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(*
> StaticParametersInterceptor.java:105*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(*
> CheckboxInterceptor.java:83*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(*
> FileUploadInterceptor.java:207*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(*
> ModelDrivenInterceptor.java:74*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at
>
> com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(*
> ScopedModelDrivenInterceptor.java:127*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at
> org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(*
> ProfilingActivationInterceptor.java:107*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at
> org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(*
> DebuggingInterceptor.java:206*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(*
> ChainingInterceptor.java:115*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(*
> I18nInterceptor.java:143*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(*
> PrepareInterceptor.java:121*)
>
> at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(*
> MethodFilterInterceptor.java:86*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(*
> ServletConfigInterceptor.java:170*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(*
> AliasInterceptor.java:123*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at
> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(*
> ExceptionMappingInterceptor.java:176*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:224*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
> DefaultActionInvocation.java:223*)
>
> at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
> UtilTimerStack.java:455*)
>
> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
> DefaultActionInvocation.java:221*)
>
> at org.apache.struts2.impl.StrutsActionProxy.execute(*
> StrutsActionProxy.java:50*)
>
> at org.apache.struts2.dispatcher.Dispatcher.serviceAction(*
> Dispatcher.java:504*)
>
> at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(*
> FilterDispatcher.java:419*)
>
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
> ApplicationFilterChain.java:235*)
>
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
> ApplicationFilterChain.java:206*)
>
> at org.apache.catalina.core.StandardWrapperValve.invoke(*
> StandardWrapperValve.java:230*)
>
> at org.apache.catalina.core.StandardContextValve.invoke(*
> StandardContextValve.java:175*)
>
> at org.apache.catalina.core.StandardHostValve.invoke(*
> StandardHostValve.java:128*)
>
> at org.apache.catalina.valves.ErrorReportValve.invoke(*
> ErrorReportValve.java:104*)
>
> at org.apache.catalina.core.StandardEngineValve.invoke(*
> StandardEngineValve.java:109*)
>
> at org.apache.catalina.connector.CoyoteAdapter.service(*
> CoyoteAdapter.java:261*)
>
> at org.apache.coyote.http11.Http11Processor.process(*
> Http11Processor.java:844*)
>
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(*
> Http11Protocol.java:581*)
>
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(*JIoEndpoint.java:447*)
>
> at java.lang.Thread.run(Unknown Source)
>
>
> On 10/9/08, aum strut <au...@gmail.com> wrote:
> >
> >  Thaks laurie
> >
> > this was exactly i was looking for...
> > i will try this way and it seems to be a good way .
> >
> > Thanks for the help
> >
> >
> >  On Thu, Oct 9, 2008 at 1:32 PM, Laurie Harper <la...@holoweb.net>
> wrote:
> >
> >> You can't expose two different beans with one getModel() method, if
> that's
> >> what you're asking. You can, however, return a simple 'wrapper' bean
> from
> >> getModel() which has a getter/setter pair for each of your target beans.
> >>
> >> Either approach gives you a way to address the two beans independently,
> >> either explicitly as in <action>.getBean1().setField1() on implicitly as
> in
> >> <action>.getModel().getBean1().setField1().
> >>
> >> L.
> >>
> >>
> >> aum strut wrote:
> >>
> >>> Yes Dave , There is a sigle form(Page) for this with different sections
> >>> in
> >>> it for registration.i only want that the data from this single page
> >>> should
> >>> go to different (2 in my case) beans depends upon the fields i have
> >>> defined
> >>> in the respective beans.
> >>>
> >>>
> >>> i tied this and is working fine but i want that i should seperate the
> >>> getter
> >>> and setter from my action
> >>>
> >>> i am using model driven approach and it is filling one beans accurately
> >>> but
> >>> i can not fill the second beans in the same getModel() .
> >>>
> >>> any other approach so that i can fill thm at the same time once my
> action
> >>> get called .
> >>>
> >>> On Thu, Oct 9, 2008 at 3:46 AM, Laurie Harper <la...@holoweb.net>
> >>> wrote:
> >>>
> >>> Just do what Dave outlined in his previous reply. You need
> getter/setters
> >>>> in your action for each bean ([gs]etBean1(), [gs]etBean2() to
> correspond
> >>>> with Dave's JSP sample code) and everything should work. Have you
> tried
> >>>> it?
> >>>>
> >>>> L.
> >>>>
> >>>>
> >>>> aum strut wrote:
> >>>>
> >>>> the issue is i have a registration from in the UI  which have two
> >>>>> different
> >>>>> section in a single page.
> >>>>>
> >>>>> 1) User login Information
> >>>>> 2)Address Information
> >>>>>
> >>>>> i want that these two sections should get populated in two different
> >>>>> Bean
> >>>>> by
> >>>>> the interceptor
> >>>>> that mean User login fields get Pouplated in the UserLogin Beans
> while
> >>>>> the
> >>>>> Address section should  get populated in the Address Bean when my
> >>>>> Registration Action get called once user will hit the Register
> Button.
> >>>>>
> >>>>>
> >>>>> Thanks
> >>>>> -aum
> >>>>>
> >>>>>
> >>>>> On Tue, Oct 7, 2008 at 10:59 PM, Dave Newton <ne...@yahoo.com>
> >>>>> wrote:
> >>>>>
> >>>>> --- On Tue, 10/7/08, aum strut wrote:
> >>>>>
> >>>>>> i need to transfer data from the user registration page to
> >>>>>>> the java beans to be used for inserting values in the data base.
> >>>>>>> i have created two seperate beans for this 1) for storing user
> >>>>>>> address field and second is for storing user login information.
> >>>>>>>
> >>>>>>> i want that when user cllick on the REgister button these
> >>>>>>> two Beans get filled with the respective  values from the UI.
> >>>>>>> i have named the corresponding fields in the beans with respect
> >>>>>>> to the fields name in the UI.
> >>>>>>>
> >>>>>>> What, precisely, is the issue?
> >>>>>>
> >>>>>> If you have a form containing:
> >>>>>>
> >>>>>> <s:textfield name="bean1.aField"/>
> >>>>>> <s:textfield name="bean2.anotherField"/>
> >>>>>>
> >>>>>> each bean will contain whatever was entered in the form.
> >>>>>>
> >>>>>> Dave
> >>>>>>
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>>>> For additional commands, e-mail: user-help@struts.apache.org
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>> For additional commands, e-mail: user-help@struts.apache.org
> >>>>
> >>>>
> >>>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >>
> >
> >
>



-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

Re: Struts2 Data Transfer

Posted by aum strut <au...@gmail.com>.
Hi All,

i tried to follow the the way suggested by Laurie i followed the below
mentioned practice.

1) I have two beans which i want to fill at the same time when the user hit
the registration button after filling the form.

2) in my action calss i am using the model driven approach to fill the two
beans using getMOdel() method

3) For this i creaded another beans with the getter and setter for thse two
above mentioed beans

below is the code i have written in my REgister  Action class


*

public* *class* UserRegistrationAction *extends* ActionSupport
*implements*ModelDriven<RegisterBean> {

/**

*

*/

*private* *static* *final* *long* *serialVersionUID* = 1L;

 *public* String execute() *throws* Exception{

 *return* *SUCCESS*;

}

*private* RegisterBean registerBean=*new* RegisterBean();



*public* RegisterBean getModel() {

*return* registerBean;

}



 }
but i am getting the below mentoed exception in the console which is saying
that i have not configured the system if the resulkt type is input

*but if i will remove* "*return* registerBean;" line from my *getModel()*and "
*return* registerBean;""*return* null;"* the exception will no longer be
there*


can anybody suggest me where i am wrong???

SEVERE: Could not find action or result

No result defined for action
com.dograpress.raisonne.registration.UserRegistrationAction and result input
- action -
file:/F:/EclipseProjects/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/DograPress/WEB-INF/classes/struts-UserRegistration.xml:6:105

at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(*
DefaultActionInvocation.java:350*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:253*)

at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(*
ValidationInterceptor.java:150*)

at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(
*AnnotationValidationInterceptor.java:48*)

at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(*
MethodFilterInterceptor.java:86*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(
*ConversionErrorInterceptor.java:123*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(*
ParametersInterceptor.java:186*)

at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(*
MethodFilterInterceptor.java:86*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(*
StaticParametersInterceptor.java:105*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(*
CheckboxInterceptor.java:83*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(*
FileUploadInterceptor.java:207*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(*
ModelDrivenInterceptor.java:74*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(*
ScopedModelDrivenInterceptor.java:127*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(*
ProfilingActivationInterceptor.java:107*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(*
DebuggingInterceptor.java:206*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(*
ChainingInterceptor.java:115*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(*
I18nInterceptor.java:143*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(*
PrepareInterceptor.java:121*)

at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(*
MethodFilterInterceptor.java:86*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(*
ServletConfigInterceptor.java:170*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(*
AliasInterceptor.java:123*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(*
ExceptionMappingInterceptor.java:176*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:224*)

at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(*
DefaultActionInvocation.java:223*)

at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(*
UtilTimerStack.java:455*)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(*
DefaultActionInvocation.java:221*)

at org.apache.struts2.impl.StrutsActionProxy.execute(*
StrutsActionProxy.java:50*)

at org.apache.struts2.dispatcher.Dispatcher.serviceAction(*
Dispatcher.java:504*)

at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(*
FilterDispatcher.java:419*)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
ApplicationFilterChain.java:235*)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
ApplicationFilterChain.java:206*)

at org.apache.catalina.core.StandardWrapperValve.invoke(*
StandardWrapperValve.java:230*)

at org.apache.catalina.core.StandardContextValve.invoke(*
StandardContextValve.java:175*)

at org.apache.catalina.core.StandardHostValve.invoke(*
StandardHostValve.java:128*)

at org.apache.catalina.valves.ErrorReportValve.invoke(*
ErrorReportValve.java:104*)

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

at org.apache.catalina.connector.CoyoteAdapter.service(*
CoyoteAdapter.java:261*)

at org.apache.coyote.http11.Http11Processor.process(*
Http11Processor.java:844*)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(*
Http11Protocol.java:581*)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(*JIoEndpoint.java:447*)

at java.lang.Thread.run(Unknown Source)


On 10/9/08, aum strut <au...@gmail.com> wrote:
>
>  Thaks laurie
>
> this was exactly i was looking for...
> i will try this way and it seems to be a good way .
>
> Thanks for the help
>
>
>  On Thu, Oct 9, 2008 at 1:32 PM, Laurie Harper <la...@holoweb.net> wrote:
>
>> You can't expose two different beans with one getModel() method, if that's
>> what you're asking. You can, however, return a simple 'wrapper' bean from
>> getModel() which has a getter/setter pair for each of your target beans.
>>
>> Either approach gives you a way to address the two beans independently,
>> either explicitly as in <action>.getBean1().setField1() on implicitly as in
>> <action>.getModel().getBean1().setField1().
>>
>> L.
>>
>>
>> aum strut wrote:
>>
>>> Yes Dave , There is a sigle form(Page) for this with different sections
>>> in
>>> it for registration.i only want that the data from this single page
>>> should
>>> go to different (2 in my case) beans depends upon the fields i have
>>> defined
>>> in the respective beans.
>>>
>>>
>>> i tied this and is working fine but i want that i should seperate the
>>> getter
>>> and setter from my action
>>>
>>> i am using model driven approach and it is filling one beans accurately
>>> but
>>> i can not fill the second beans in the same getModel() .
>>>
>>> any other approach so that i can fill thm at the same time once my action
>>> get called .
>>>
>>> On Thu, Oct 9, 2008 at 3:46 AM, Laurie Harper <la...@holoweb.net>
>>> wrote:
>>>
>>> Just do what Dave outlined in his previous reply. You need getter/setters
>>>> in your action for each bean ([gs]etBean1(), [gs]etBean2() to correspond
>>>> with Dave's JSP sample code) and everything should work. Have you tried
>>>> it?
>>>>
>>>> L.
>>>>
>>>>
>>>> aum strut wrote:
>>>>
>>>> the issue is i have a registration from in the UI  which have two
>>>>> different
>>>>> section in a single page.
>>>>>
>>>>> 1) User login Information
>>>>> 2)Address Information
>>>>>
>>>>> i want that these two sections should get populated in two different
>>>>> Bean
>>>>> by
>>>>> the interceptor
>>>>> that mean User login fields get Pouplated in the UserLogin Beans while
>>>>> the
>>>>> Address section should  get populated in the Address Bean when my
>>>>> Registration Action get called once user will hit the Register Button.
>>>>>
>>>>>
>>>>> Thanks
>>>>> -aum
>>>>>
>>>>>
>>>>> On Tue, Oct 7, 2008 at 10:59 PM, Dave Newton <ne...@yahoo.com>
>>>>> wrote:
>>>>>
>>>>> --- On Tue, 10/7/08, aum strut wrote:
>>>>>
>>>>>> i need to transfer data from the user registration page to
>>>>>>> the java beans to be used for inserting values in the data base.
>>>>>>> i have created two seperate beans for this 1) for storing user
>>>>>>> address field and second is for storing user login information.
>>>>>>>
>>>>>>> i want that when user cllick on the REgister button these
>>>>>>> two Beans get filled with the respective  values from the UI.
>>>>>>> i have named the corresponding fields in the beans with respect
>>>>>>> to the fields name in the UI.
>>>>>>>
>>>>>>> What, precisely, is the issue?
>>>>>>
>>>>>> If you have a form containing:
>>>>>>
>>>>>> <s:textfield name="bean1.aField"/>
>>>>>> <s:textfield name="bean2.anotherField"/>
>>>>>>
>>>>>> each bean will contain whatever was entered in the form.
>>>>>>
>>>>>> Dave
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
>

Re: Struts2 Data Transfer

Posted by aum strut <au...@gmail.com>.
Thaks laurie

this was exactly i was looking for...
i will try this way and it seems to be a good way .

Thanks for the help

On Thu, Oct 9, 2008 at 1:32 PM, Laurie Harper <la...@holoweb.net> wrote:

> You can't expose two different beans with one getModel() method, if that's
> what you're asking. You can, however, return a simple 'wrapper' bean from
> getModel() which has a getter/setter pair for each of your target beans.
>
> Either approach gives you a way to address the two beans independently,
> either explicitly as in <action>.getBean1().setField1() on implicitly as in
> <action>.getModel().getBean1().setField1().
>
> L.
>
>
> aum strut wrote:
>
>> Yes Dave , There is a sigle form(Page) for this with different sections in
>> it for registration.i only want that the data from this single page should
>> go to different (2 in my case) beans depends upon the fields i have
>> defined
>> in the respective beans.
>>
>>
>> i tied this and is working fine but i want that i should seperate the
>> getter
>> and setter from my action
>>
>> i am using model driven approach and it is filling one beans accurately
>> but
>> i can not fill the second beans in the same getModel() .
>>
>> any other approach so that i can fill thm at the same time once my action
>> get called .
>>
>> On Thu, Oct 9, 2008 at 3:46 AM, Laurie Harper <la...@holoweb.net> wrote:
>>
>> Just do what Dave outlined in his previous reply. You need getter/setters
>>> in your action for each bean ([gs]etBean1(), [gs]etBean2() to correspond
>>> with Dave's JSP sample code) and everything should work. Have you tried
>>> it?
>>>
>>> L.
>>>
>>>
>>> aum strut wrote:
>>>
>>> the issue is i have a registration from in the UI  which have two
>>>> different
>>>> section in a single page.
>>>>
>>>> 1) User login Information
>>>> 2)Address Information
>>>>
>>>> i want that these two sections should get populated in two different
>>>> Bean
>>>> by
>>>> the interceptor
>>>> that mean User login fields get Pouplated in the UserLogin Beans while
>>>> the
>>>> Address section should  get populated in the Address Bean when my
>>>> Registration Action get called once user will hit the Register Button.
>>>>
>>>>
>>>> Thanks
>>>> -aum
>>>>
>>>>
>>>> On Tue, Oct 7, 2008 at 10:59 PM, Dave Newton <ne...@yahoo.com>
>>>> wrote:
>>>>
>>>> --- On Tue, 10/7/08, aum strut wrote:
>>>>
>>>>> i need to transfer data from the user registration page to
>>>>>> the java beans to be used for inserting values in the data base.
>>>>>> i have created two seperate beans for this 1) for storing user
>>>>>> address field and second is for storing user login information.
>>>>>>
>>>>>> i want that when user cllick on the REgister button these
>>>>>> two Beans get filled with the respective  values from the UI.
>>>>>> i have named the corresponding fields in the beans with respect
>>>>>> to the fields name in the UI.
>>>>>>
>>>>>> What, precisely, is the issue?
>>>>>
>>>>> If you have a form containing:
>>>>>
>>>>> <s:textfield name="bean1.aField"/>
>>>>> <s:textfield name="bean2.anotherField"/>
>>>>>
>>>>> each bean will contain whatever was entered in the form.
>>>>>
>>>>> Dave
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Struts2 Data Transfer

Posted by Laurie Harper <la...@holoweb.net>.
You can't expose two different beans with one getModel() method, if 
that's what you're asking. You can, however, return a simple 'wrapper' 
bean from getModel() which has a getter/setter pair for each of your 
target beans.

Either approach gives you a way to address the two beans independently, 
either explicitly as in <action>.getBean1().setField1() on implicitly as 
in <action>.getModel().getBean1().setField1().

L.

aum strut wrote:
> Yes Dave , There is a sigle form(Page) for this with different sections in
> it for registration.i only want that the data from this single page should
> go to different (2 in my case) beans depends upon the fields i have defined
> in the respective beans.
> 
> 
> i tied this and is working fine but i want that i should seperate the getter
> and setter from my action
> 
> i am using model driven approach and it is filling one beans accurately but
> i can not fill the second beans in the same getModel() .
> 
> any other approach so that i can fill thm at the same time once my action
> get called .
> 
> On Thu, Oct 9, 2008 at 3:46 AM, Laurie Harper <la...@holoweb.net> wrote:
> 
>> Just do what Dave outlined in his previous reply. You need getter/setters
>> in your action for each bean ([gs]etBean1(), [gs]etBean2() to correspond
>> with Dave's JSP sample code) and everything should work. Have you tried it?
>>
>> L.
>>
>>
>> aum strut wrote:
>>
>>> the issue is i have a registration from in the UI  which have two
>>> different
>>> section in a single page.
>>>
>>> 1) User login Information
>>> 2)Address Information
>>>
>>> i want that these two sections should get populated in two different Bean
>>> by
>>> the interceptor
>>> that mean User login fields get Pouplated in the UserLogin Beans while the
>>> Address section should  get populated in the Address Bean when my
>>> Registration Action get called once user will hit the Register Button.
>>>
>>>
>>> Thanks
>>> -aum
>>>
>>>
>>> On Tue, Oct 7, 2008 at 10:59 PM, Dave Newton <ne...@yahoo.com>
>>> wrote:
>>>
>>> --- On Tue, 10/7/08, aum strut wrote:
>>>>> i need to transfer data from the user registration page to
>>>>> the java beans to be used for inserting values in the data base.
>>>>> i have created two seperate beans for this 1) for storing user
>>>>> address field and second is for storing user login information.
>>>>>
>>>>> i want that when user cllick on the REgister button these
>>>>> two Beans get filled with the respective  values from the UI.
>>>>> i have named the corresponding fields in the beans with respect
>>>>> to the fields name in the UI.
>>>>>
>>>> What, precisely, is the issue?
>>>>
>>>> If you have a form containing:
>>>>
>>>> <s:textfield name="bean1.aField"/>
>>>> <s:textfield name="bean2.anotherField"/>
>>>>
>>>> each bean will contain whatever was entered in the form.
>>>>
>>>> Dave
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 


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


Re: Struts2 Data Transfer

Posted by aum strut <au...@gmail.com>.
Yes Dave , There is a sigle form(Page) for this with different sections in
it for registration.i only want that the data from this single page should
go to different (2 in my case) beans depends upon the fields i have defined
in the respective beans.


i tied this and is working fine but i want that i should seperate the getter
and setter from my action

i am using model driven approach and it is filling one beans accurately but
i can not fill the second beans in the same getModel() .

any other approach so that i can fill thm at the same time once my action
get called .

On Thu, Oct 9, 2008 at 3:46 AM, Laurie Harper <la...@holoweb.net> wrote:

> Just do what Dave outlined in his previous reply. You need getter/setters
> in your action for each bean ([gs]etBean1(), [gs]etBean2() to correspond
> with Dave's JSP sample code) and everything should work. Have you tried it?
>
> L.
>
>
> aum strut wrote:
>
>> the issue is i have a registration from in the UI  which have two
>> different
>> section in a single page.
>>
>> 1) User login Information
>> 2)Address Information
>>
>> i want that these two sections should get populated in two different Bean
>> by
>> the interceptor
>> that mean User login fields get Pouplated in the UserLogin Beans while the
>> Address section should  get populated in the Address Bean when my
>> Registration Action get called once user will hit the Register Button.
>>
>>
>> Thanks
>> -aum
>>
>>
>> On Tue, Oct 7, 2008 at 10:59 PM, Dave Newton <ne...@yahoo.com>
>> wrote:
>>
>> --- On Tue, 10/7/08, aum strut wrote:
>>>
>>>> i need to transfer data from the user registration page to
>>>> the java beans to be used for inserting values in the data base.
>>>> i have created two seperate beans for this 1) for storing user
>>>> address field and second is for storing user login information.
>>>>
>>>> i want that when user cllick on the REgister button these
>>>> two Beans get filled with the respective  values from the UI.
>>>> i have named the corresponding fields in the beans with respect
>>>> to the fields name in the UI.
>>>>
>>> What, precisely, is the issue?
>>>
>>> If you have a form containing:
>>>
>>> <s:textfield name="bean1.aField"/>
>>> <s:textfield name="bean2.anotherField"/>
>>>
>>> each bean will contain whatever was entered in the form.
>>>
>>> Dave
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

move items between two listboxes and update DB ??

Posted by "A. Lotfi" <ma...@yahoo.com>.
Hi,
I want to create a jsp page that has users populated from a database, when I click in a user two listboxes appear:
  listAssignedRoles with assigned roles
listNoAssignedRoles the rest of roles not assigned yet
   
  These two lists are populated from a the database.
  I want when I move items between listboxes and hit submit button the database get updated too.
  Please your help is appreciated.
  thanks

"A. Lotfi" <ma...@yahoo.com> wrote:
  I did not start it yet, struts version is 1.2.8

thanks

Dave Newton wrote:
--- On Thu, 10/9/08, A. Lotfi wrote:
> a list of users when you click in a user it show two
> other lists :
> Roles assigned
> Roles notassigned
> 
> so we can remove and assign roles to the current user

You should probably mention which version of Struts you're using.

How far have you gotten on your own? Do you have any specific questions?

Dave


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





       

Re: struts users assign remove roles

Posted by "A. Lotfi" <ma...@yahoo.com>.
I did not start it yet, struts version is 1.2.8
   
  thanks

Dave Newton <ne...@yahoo.com> wrote:
  --- On Thu, 10/9/08, A. Lotfi wrote:
> a list of users when you click in a user it show two
> other lists :
> Roles assigned
> Roles notassigned
> 
> so we can remove and assign roles to the current user

You should probably mention which version of Struts you're using.

How far have you gotten on your own? Do you have any specific questions?

Dave


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



       

Re: struts users assign remove roles

Posted by Dave Newton <ne...@yahoo.com>.
--- On Thu, 10/9/08, A. Lotfi wrote:
> a list of users when you click in a user it show two
> other lists :
>   Roles assigned
>   Roles notassigned
>    
> so we can remove and assign roles to the current user

You should probably mention which version of Struts you're using.

How far have you gotten on your own? Do you have any specific questions?

Dave


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


struts users assign remove roles

Posted by "A. Lotfi" <ma...@yahoo.com>.
Hi,
   
  I need to create a web application that has a jsp page showing :
  a list of users when you click in a user it show two other lists :
  Roles assigned
  Roles notassigned
   
  so we can remove and assign roles to the current user (clicked on) ,
   
   
  Please any idea or a hint or an example on how to do it.
   
  thanks, your help is appreciated.
   
  Kaml.

       

Re: Custom Tag Libs

Posted by "David C. Hicks" <dh...@i-hicks.org>.
Thanks for the feedback, guys.  I actually asked this question for a 
fellow developer.  He's more of a JSP "guru", if you will, but Struts2 
seems to handle taglibs differently.  So, it was a bit confusing to us 
all.  I think he's found some kind of solution, but I will definitely 
forward these responses on to him.  I'm not sure exactly what problem he 
was trying to solve.  Sorry.  I appreciate all the feedback, though!

Dave


Alberto A. Flores wrote:
> I disagree about the difficulty level of writing your tag in Struts2.
> However, I would strongly encourage you (as others have) to see if an
> already existing tag doesn't fit your needs. I'm hoping to post something in
> my blog about some of this soon, however it would be worthwhile to state
> what you are trying to accomplish.
>
>
> On Wed, Oct 8, 2008 at 7:06 PM, <st...@gmail.com> wrote:
>
>   
>> David --
>>
>> I would strongly discourage you from writing your own custom tags until you
>> discover there is not already one "in the box!"  Besides Struts 2, you
>> still
>> have all the JSTL tags available as well.   If by "old school" you mean you
>> haven't looked around the available tags today, your best bet would be to
>> start looking.  Writing your own tags can be a pain in the rear.
>>
>> Scott
>>
>> On Wed, Oct 8, 2008 at 5:20 PM, David C. Hicks <dh...@i-hicks.org> wrote:
>>
>>     
>>> Can anyone point me to a source of information about how to build a
>>>       
>> custom
>>     
>>> tag lib for Struts2?  Maybe it's a plugin?  I'm a little old school and
>>> still learning.
>>>
>>> Thanks!
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>       
>
>
>
>   

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


Re: Custom Tag Libs

Posted by "Alberto A. Flores" <aa...@gmail.com>.
I disagree about the difficulty level of writing your tag in Struts2.
However, I would strongly encourage you (as others have) to see if an
already existing tag doesn't fit your needs. I'm hoping to post something in
my blog about some of this soon, however it would be worthwhile to state
what you are trying to accomplish.


On Wed, Oct 8, 2008 at 7:06 PM, <st...@gmail.com> wrote:

> David --
>
> I would strongly discourage you from writing your own custom tags until you
> discover there is not already one "in the box!"  Besides Struts 2, you
> still
> have all the JSTL tags available as well.   If by "old school" you mean you
> haven't looked around the available tags today, your best bet would be to
> start looking.  Writing your own tags can be a pain in the rear.
>
> Scott
>
> On Wed, Oct 8, 2008 at 5:20 PM, David C. Hicks <dh...@i-hicks.org> wrote:
>
> > Can anyone point me to a source of information about how to build a
> custom
> > tag lib for Struts2?  Maybe it's a plugin?  I'm a little old school and
> > still learning.
> >
> > Thanks!
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>



-- 
Alberto
http://www.linkedin.com/in/aflores

Re: Custom Tag Libs

Posted by st...@gmail.com.
David --

I would strongly discourage you from writing your own custom tags until you
discover there is not already one "in the box!"  Besides Struts 2, you still
have all the JSTL tags available as well.   If by "old school" you mean you
haven't looked around the available tags today, your best bet would be to
start looking.  Writing your own tags can be a pain in the rear.

Scott

On Wed, Oct 8, 2008 at 5:20 PM, David C. Hicks <dh...@i-hicks.org> wrote:

> Can anyone point me to a source of information about how to build a custom
> tag lib for Struts2?  Maybe it's a plugin?  I'm a little old school and
> still learning.
>
> Thanks!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Custom Tag Libs

Posted by Dave Newton <ne...@yahoo.com>.
--- On Wed, 10/8/08, David C. Hicks wrote:
> Can anyone point me to a source of information about how to
> build a custom tag lib for Struts2?  Maybe it's a plugin? 
> I'm a little old school and still learning.

Depends on what you mean, I guess--you can create a standard JEE custom tag using either Java or JSP (JSP 2.0+ containers only). If your goal is to subclass or extend existing S2 tags then your best bet is to start looking at the existing tag's source code, but it can be a little... obtuse at times.

(In theory I have a small PDF in the works discussing this but due to timing issues will remain dormant until closer to the end of the year.)

Dave


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


Custom Tag Libs

Posted by "David C. Hicks" <dh...@i-hicks.org>.
Can anyone point me to a source of information about how to build a 
custom tag lib for Struts2?  Maybe it's a plugin?  I'm a little old 
school and still learning.

Thanks!


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


Re: Struts2 Data Transfer

Posted by Laurie Harper <la...@holoweb.net>.
Just do what Dave outlined in his previous reply. You need 
getter/setters in your action for each bean ([gs]etBean1(), 
[gs]etBean2() to correspond with Dave's JSP sample code) and everything 
should work. Have you tried it?

L.

aum strut wrote:
> the issue is i have a registration from in the UI  which have two different
> section in a single page.
> 
> 1) User login Information
> 2)Address Information
> 
> i want that these two sections should get populated in two different Bean by
> the interceptor
> that mean User login fields get Pouplated in the UserLogin Beans while the
> Address section should  get populated in the Address Bean when my
> Registration Action get called once user will hit the Register Button.
> 
> 
> Thanks
> -aum
> 
> 
> On Tue, Oct 7, 2008 at 10:59 PM, Dave Newton <ne...@yahoo.com> wrote:
> 
>> --- On Tue, 10/7/08, aum strut wrote:
>>> i need to transfer data from the user registration page to
>>> the java beans to be used for inserting values in the data base.
>>> i have created two seperate beans for this 1) for storing user
>>> address field and second is for storing user login information.
>>>
>>> i want that when user cllick on the REgister button these
>>> two Beans get filled with the respective  values from the UI.
>>> i have named the corresponding fields in the beans with respect
>>> to the fields name in the UI.
>> What, precisely, is the issue?
>>
>> If you have a form containing:
>>
>> <s:textfield name="bean1.aField"/>
>> <s:textfield name="bean2.anotherField"/>
>>
>> each bean will contain whatever was entered in the form.
>>
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 


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


Re: Struts2 Data Transfer

Posted by Dave Newton <ne...@yahoo.com>.
--- On Wed, 10/8/08, aum strut wrote:
> the issue is i have a registration from in the UI  which
> have two different section in a single page.
> 
> 1) User login Information
> 2)Address Information
> 
> i want that these two sections should get populated in two
> different Bean by the interceptor that mean User login fields get 
> Pouplated in the UserLogin Beans while the Address section should  
> [...]

In the same form?

Dave


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


Re: Struts2 Data Transfer

Posted by aum strut <au...@gmail.com>.
the issue is i have a registration from in the UI  which have two different
section in a single page.

1) User login Information
2)Address Information

i want that these two sections should get populated in two different Bean by
the interceptor
that mean User login fields get Pouplated in the UserLogin Beans while the
Address section should  get populated in the Address Bean when my
Registration Action get called once user will hit the Register Button.


Thanks
-aum


On Tue, Oct 7, 2008 at 10:59 PM, Dave Newton <ne...@yahoo.com> wrote:

> --- On Tue, 10/7/08, aum strut wrote:
> > i need to transfer data from the user registration page to
> > the java beans to be used for inserting values in the data base.
> > i have created two seperate beans for this 1) for storing user
> > address field and second is for storing user login information.
> >
> > i want that when user cllick on the REgister button these
> > two Beans get filled with the respective  values from the UI.
> > i have named the corresponding fields in the beans with respect
> > to the fields name in the UI.
>
> What, precisely, is the issue?
>
> If you have a form containing:
>
> <s:textfield name="bean1.aField"/>
> <s:textfield name="bean2.anotherField"/>
>
> each bean will contain whatever was entered in the form.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Struts2 Data Transfer

Posted by Dave Newton <ne...@yahoo.com>.
--- On Tue, 10/7/08, aum strut wrote:
> i need to transfer data from the user registration page to
> the java beans to be used for inserting values in the data base.
> i have created two seperate beans for this 1) for storing user
> address field and second is for storing user login information.
> 
> i want that when user cllick on the REgister button these
> two Beans get filled with the respective  values from the UI. 
> i have named the corresponding fields in the beans with respect 
> to the fields name in the UI.

What, precisely, is the issue?

If you have a form containing:

<s:textfield name="bean1.aField"/>
<s:textfield name="bean2.anotherField"/>

each bean will contain whatever was entered in the form.

Dave


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