Re: int's and OGNL in struts.xml

2010-04-01 Thread Chris Pratt
Unfortunately, we're not up to 2.1.8 yet.  And this really struck me as more
of an OGNL problem of not being able to pass on an int as an int than a
plugin problem.
  (*Chris*)

On Thu, Apr 1, 2010 at 2:29 PM, Martin Gainty  wrote:

>
> you can get/string widths with struts-2.1.8 ChartResult
>
>
>
>public String getWidth() {
>return width;
>}
>
>public void setWidth(String width) {
>this.width = width;
>}
>
>
>
> http://struts.apache.org/download.cgi
>
> hth
> Martin Gainty
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
>
> > Date: Thu, 1 Apr 2010 11:07:34 -0700
> > Subject: int's and OGNL in struts.xml
> > From: thechrispr...@gmail.com
> > To: user@struts.apache.org
> >
> > I'm trying to use the OGNL support in Struts 2.0.14 to set some parameter
> > values in the jFreeChart plugin's chart result type. But I keep getting
> > errors because it appears to be expecting all properties to be Strings,
> even
> > if the OGNL doesn't return a String. I'm using:
> >
> >  > class="com.vsp.global.controller.ChartFrameSelectionRateAction">
> > user
> > 
> > $...@com.example.config@getInt
> ("reports","frameSelectionRate.width")}
> > $...@com.example.config@getInt
> ("reports","frameSelectionRate.height")}
> > 
> > 404
> > 
> >
> > Where
> >
> > where com.example.Config.getInt is defined as
> >
> > public int getInt (String domain,String key);
> >
> >
> > But when struts tries to instantiate the result I get:
> >
> > [2010-04-01 10:46:57,785] ERROR {abcOu3jlPU3Rf_9tFPSzs}
> > DefaultActionInvocation.createResult: There was an exception while
> > instantiating the result of type
> org.apache.struts2.dispatcher.ChartResult
> > Caught OgnlException while setting property 'width' on type
> > 'org.apache.struts2.dispatcher.ChartResult'. - Class: ognl.OgnlRuntime
> > File: OgnlRuntime.java
> > Method: callAppropriateMethod
> > Line: 1206 - ognl/OgnlRuntime.java:1206:-1
> > at
> >
> com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:367)
> > at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
> > .
> > .
> > .
> > Caused by: java.lang.NoSuchMethodException:
> > org.apache.struts2.dispatcher.ChartResult.setWidth(java.lang.String)
> > at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1206)
> > at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1454)
> > at
> >
> ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85)
> > at
> > ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
> >
> >
> > Is there any way to make struts recognize that the value is an int, so it
> > needs to call setWidth(int)?
> > (*Chris*)
>
> _
> Hotmail has tools for the New Busy. Search, chat and e-mail from your
> inbox.
>
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_1
>


Generics and custom Type Converter (Struts 2.1.8)

2010-04-01 Thread Sundar Sankar
Hi
I had a weird problem earlier where, if my pojo had a variable of type
"Date", struts was looking for setVariable(String) instead of a
setVariable(Date) for browser locale = es_Cl. I wrote a custom type handler
to solve this problem. Now am stuck with the same problem where I have a
list into which Struts needs to set the date.

>From the documentation, I added the Element_variable, KeyProperty_variable
and CreatIfNUll_variable, variable=Custom Type Handler into my property
file. This is what happens

1. ) Struts by defaults looks for convertToString method in my converter
class.
2.) When i set my debug, the setVariable is first called and then is the
converter invoked. To solve problem1, I added convertValue and made it
madatorily convert it to date and return that instead of a string. Even
after that, Struts seems to be setting into an instance that isn't what is
in the action class.

As usual, this behaviour is just happening for es_CL locale on my browser
and not when the browser locale is  en_US.

Any help is much appreciated.

-- 
Regards
Sundar S.


RE: int's and OGNL in struts.xml

2010-04-01 Thread Martin Gainty

you can get/string widths with struts-2.1.8 ChartResult

 

public String getWidth() {
return width;
}

public void setWidth(String width) {
this.width = width;
}

 

http://struts.apache.org/download.cgi

hth
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.



 

> Date: Thu, 1 Apr 2010 11:07:34 -0700
> Subject: int's and OGNL in struts.xml
> From: thechrispr...@gmail.com
> To: user@struts.apache.org
> 
> I'm trying to use the OGNL support in Struts 2.0.14 to set some parameter
> values in the jFreeChart plugin's chart result type. But I keep getting
> errors because it appears to be expecting all properties to be Strings, even
> if the OGNL doesn't return a String. I'm using:
> 
>  class="com.vsp.global.controller.ChartFrameSelectionRateAction">
> user
> 
>  name="width">$...@com.example.config@getInt("reports","frameSelectionRate.width")}
>  name="height">$...@com.example.config@getInt("reports","frameSelectionRate.height")}
> 
> 404
> 
> 
> Where
> 
> where com.example.Config.getInt is defined as
> 
> public int getInt (String domain,String key);
> 
> 
> But when struts tries to instantiate the result I get:
> 
> [2010-04-01 10:46:57,785] ERROR {abcOu3jlPU3Rf_9tFPSzs}
> DefaultActionInvocation.createResult: There was an exception while
> instantiating the result of type org.apache.struts2.dispatcher.ChartResult
> Caught OgnlException while setting property 'width' on type
> 'org.apache.struts2.dispatcher.ChartResult'. - Class: ognl.OgnlRuntime
> File: OgnlRuntime.java
> Method: callAppropriateMethod
> Line: 1206 - ognl/OgnlRuntime.java:1206:-1
> at
> com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:367)
> at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
> .
> .
> .
> Caused by: java.lang.NoSuchMethodException:
> org.apache.struts2.dispatcher.ChartResult.setWidth(java.lang.String)
> at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1206)
> at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1454)
> at
> ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85)
> at
> ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
> 
> 
> Is there any way to make struts recognize that the value is an int, so it
> needs to call setWidth(int)?
> (*Chris*)
  
_
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_1

Nested tiles question

2010-04-01 Thread Subir Kumar
Hi guys,

This is a question for Struts Tiles group.

I've created more than one layout JSP for the site as there are more that one 
layout for the site. But I also want to have kind of a parent layout JSP which 
has references to all global resources - like javascript files etc. How can 
this be achieved? I tried following, but it did not work, while JSPs are 
displayed fine I cannot access javascript functions from the base layout



    
   
    
  
  
       
    
   
    
 
    
   
    
  
       
    
   
    
 
       



Thanks,
Subir.



  

Re: SImple question on bypassing prepare

2010-04-01 Thread jayakumar ala
Thanks... I got to know how to handle this.

On Thu, Apr 1, 2010 at 1:21 PM, Kawczynski, David <
david_kawczyn...@merck.com> wrote:

> Extend ActionSupport or one of its subclasses, override the
> prepare( ) method, to call your customized method, then call
> super.prepare( ).
>
> > -Original Message-
> > From: jayakumar ala [mailto:alajay...@gmail.com]
> > Sent: Thursday, April 01, 2010 2:05 PM
> > To: Struts Users Mailing List
> > Subject: SImple question on bypassing prepare
> >
> > Hi All,
> >  I am new to struts2 and need small help on how i can bypass
> > calling prepare
> > method before any other method. In my case i am trying to
> > call customized
> > method before prepare method to set some values. I did set
> > method in my
> > struts.xml but it is still calling prepare(). I want this
> > prepare to be
> > called after calling my customized method.
> > Any help is appreciated.
> >
> > Thanks
> >
> Notice:  This e-mail message, together with any attachments, contains
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New
> Jersey, USA 08889), and/or its affiliates Direct contact information for
> affiliates is available at http://www.merck.com/contact/contacts.html)
> that may be confidential, proprietary copyrighted and/or legally privileged.
> It is intended solely for the use of the individual or entity named on this
> message. If you are not the intended recipient, and have received this
> message in error, please notify us immediately by reply e-mail and then
> delete it from your system.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


RE: SImple question on bypassing prepare

2010-04-01 Thread Kawczynski, David
Extend ActionSupport or one of its subclasses, override the 
prepare( ) method, to call your customized method, then call
super.prepare( ).

> -Original Message-
> From: jayakumar ala [mailto:alajay...@gmail.com] 
> Sent: Thursday, April 01, 2010 2:05 PM
> To: Struts Users Mailing List
> Subject: SImple question on bypassing prepare
> 
> Hi All,
>  I am new to struts2 and need small help on how i can bypass 
> calling prepare
> method before any other method. In my case i am trying to 
> call customized
> method before prepare method to set some values. I did set 
> method in my
> struts.xml but it is still calling prepare(). I want this 
> prepare to be
> called after calling my customized method.
> Any help is appreciated.
> 
> Thanks
> 
Notice:  This e-mail message, together with any attachments, contains 
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates Direct contact information for 
affiliates is available at http://www.merck.com/contact/contacts.html) that may 
be confidential, proprietary copyrighted and/or legally privileged. It is 
intended solely for the use of the individual or entity named on this message. 
If you are not the intended recipient, and have received this message in error, 
please notify us immediately by reply e-mail and then delete it from your 
system.


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



Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread bruno grandjean
In all cases, thks a lot for helping me because I was absolutely unable to 
find a solution.
I will try to test what u suggest but I must admit that I am a little bit 
frustrated and disappointed with the ModelDriven interface.
I am also trying to do the same thing with Spring, I hope to be more lucky 
;-)

bruno


--
From: "adam pinder" 
Sent: Thursday, April 01, 2010 6:19 PM
To: 
Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3




so it looks like your issue is more to do with the child values not being 
set by Struts


there have been a few postings about using the [] notation on field names 
to get struts to assign the values properly.


in struts1 i found it worked fine, however in struts2 i've not really seen 
it working... in some of my actions i have actually added a method which 
gets the parameter values off the request and populates the objects 
myself..


e.g. look for parameter names starting parent.values and use the parameter 
name/value to construct the correct call to set the object.


seems unnecessary as struts2 should handle it, but as i say i couldn't get 
it to do it with arraylists i was using.






From: brgrandj...@live.fr
To: user@struts.apache.org
Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 
3

Date: Thu, 1 Apr 2010 15:16:36 +0200


Thks a lot Adam it is now more concise:



Setting params
Setting params id => [ 1 ]
Setting params id => [ 1 ] method:saveOrUpdate => [ Submit ] name => [ 
Parent1 ] parent.values[0].id => [ 2 ] parent.values[0].name => [ 
Child2 ] parent.values[1].id => [ 1 ] parent.values[1].name => [ Child1 ]




Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.0
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
at 
com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor.getProperty(XWorkCollectionPropertyAccessor.java:80)

at java.lang.Thread.run(Unknown Source)
..
Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.0
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
..
Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.1
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
at 
com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor.getProperty(XWorkCollectionPropertyAccessor.java:80)

..
Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.1
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
at 
com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor.getProperty(XWorkCollectionPropertyAccessor.java:80)

at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
..

Setting params

Do u see something wrong??





From: apin...@hotmail.co.uk
To: user@struts.apache.org
Subject: RE: CRUD with a OneToMany association under Struts 2 / 
Hibernate 3

Date: Thu, 1 Apr 2010 13:54:58 +0100



set the rootlogger to warn

log4j.rootLogger=warn, stdout

rather than debug

you should only get a parameterinterceptor log entry every time you post 
something to the server




From: brgrandj...@live.fr
To: user@struts.apache.org
Subject: RE: CRUD with a OneToMany association under Struts 2 / 
Hibernate 3

Date: Thu, 1 Apr 2010 14:51:40 +0200


thks adam but I got now thousand & thousand of lines

I am afraid that I won't be able to read its before the end of the 
world in 2012..




I saw very quicky an exception at the beginning..

How can I limit this huge quantity of lines?



here is my log4j.properties file:



log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p 
%c{1}:%L - %m%n

log4j.rootLogger=debug, stdout
log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug








From: apin...@hotmail.co.uk
To: user@struts.apache.org
Subject: RE: CRUD with a OneToMany association under Struts 2 / 
Hibernate 3

Date: Thu, 1 Apr 2010 12:57:39 +0100




in log4j.properties file (same location as struts.xml and hibernate 
config files)


add

log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug

this will output param name/value pairs being posted from your page.





From: brgrandj...@live.fr
To: user@struts.apache.org
Subject: RE: CRUD with a OneToMany association under Struts 2 / 
Hibernate 3

Date: Thu, 1 Apr 2010 13:54:33 +0200


Dear Adam,



I just added a public Child getValues(int idx) in the Parent class 
definition but it is never called.




Could u explain to me where and how can I turn on the 
parameterinterceptor logging? In the struts.xml file?




thks a lot


bruno






From: apin...@hotmail.co.uk
To: user@struts.apache.org
Subject: RE: CRUD with a OneToMany assoc

Updating a list of objects.

2010-04-01 Thread Andreas Prudzilko

Hi,
I have quite complex object conversions in my actions. I usually convert 
a JSON object to a struts form that I send to an action.

List tagSetList;
Where TagSet has own List of Tags for example.

tagSetList = [{name:'ts1', tags: [{name: t1},{name: t2},{name: 
t3}]},{name:'ts1', tags: [{name: t1},{name: t2},{name: t3}]}]

this is then converted to a "form" format.

tagSetList[0].name=ts1&tagSetList[0].tags[0].name=t1&tagSetList[0].tags[1].name=t1&...

and so on.
This works really great however now I have a problem in the update 
entities case. If it was only one domain object I could go with and 
tagSetId parameter and a prepare method.
However in my scenario I need to intercept when setId() called so I can 
load the persistent state first, before applying my changes.


Any ideas how to do this?
I was thinking I could maybe reuse the params interceptor to set only 
*.id values, but then I would somehow need to know which objects got id 
set, so I can load them.
This all seems very much like a hack. Is there some mechanism to 
intercept setting a primary key?


Ideas and suggestions are welcome!
/Andreas

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



Error creating form bean - struts 1.2 + weblogic 8.1 + myeclipse 5.5

2010-04-01 Thread Nanu Khota
--- Begin Message ---

Hi All,

I am a newbee to struts and trying some hands on it. I was just trying to 
develop a simple login form but getting following exception on initial run only.

-

SEVERE: Error creating form bean of class com.abc.struts.form.LoginForm
java.lang.NullPointerException
at 
org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)
at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)
at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)
at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)
at jsp_servlet.__login._jspService(__login.java:196)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)

-

I tried searching thru all forums from last 2 days but could not found any 
solution to the issue. This seems to be a very common problem but I don't know 
why its not going away. I am really stuck up.

Below are the listing of files required to analyize the cause of error.

web.xml


http://java.sun.com/dtd/web-app_2_3.dtd";>

  
action
org.apache.struts.action.ActionServlet

  config
  /WEB-INF/struts-config.xml


  debug
  3


  detail
  3

0
  
  
action
*.do
  
  
index.jsp
  
  
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
  



index.jsp
-
..

Login
  
.


struts-config.xml
-

http://struts.apache.org/dtds/struts-config_1_2.dtd";>


  
  


  

  
  
  




  

  



Login.jsp
-



  

  Login:
  


  Password:
  


  Login

  

  

I can also provide the form bean and action class if required but I believe it 
won't add to solving the problem as the exception occurs when I click on the 
link on index.jsp and then it tries to render the Login.jsp.

Please help.

Nanu


Important notice: This e-mail and any attachment there to contains corporate 
proprietary information. If you have received it by mistake, please notify us 
immediately by reply e-mail and delete this e-mail and its attachments from 
your system.
Thank You.
--- End Message ---

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

Error creating form bean - nullpointerexception - struts 1.2 + weblogic 8.1 + myeclipse 5.5

2010-04-01 Thread Nanu Khota
Hi All,
I am a newbee to struts and trying some hands on it. I was just trying to 
develop a simple login form but getting following exception on initial run 
itself.
-
SEVERE: Error creating form bean of class 
com.abc.struts.form.LoginFormjava.lang.NullPointerExceptionat 
org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)at
 org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)at 
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)at 
org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)at 
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)at 
jsp_servlet.__login._jspService(__login.java:196)at 
weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
-
I tried searching thru all forums from last 2 days but could not found any 
solution to the issue. This seems to be a very common problem but I don't know 
why its not going away. I am really stuck up.
Below are the listing of files required to analyize the cause of error.
web.xml ; 
    
action    
org.apache.struts.action.ActionServlet   
   
config  
/WEB-INF/struts-config.xml   
     
  
debug  
3    
    
  
detail   &
 nbsp;  3    
    
0    
    
action    
*.do  
      
index.jsp  
    
 /WEB-INF/struts-html.tld  
 /WEB-INF/struts-html.tld 
 
index.jsp-..    Login  .
struts-config.xml-;
        
  
      
    
      

  
  
Login.jsp-
          
  
 
     
    
  
 
     
    
  &nbs
 p;     
Login:
Password:
Login
   
  I can also provide the form bean and action class if required but I believe it won't add to solving the problem as the exception occurs when I click on the link on index.jsp and then it tries to render the Login.jsp. Please help. Regards,Nanu

Re: SImple question on bypassing prepare

2010-04-01 Thread Chris Pratt
What is it that calls your customized set method?  If it's form parameter
data, move the prepare interceptor below the params interceptor in your
interceptor stack.
  (*Chris*)

On Thu, Apr 1, 2010 at 11:04 AM, jayakumar ala  wrote:

> Hi All,
>  I am new to struts2 and need small help on how i can bypass calling
> prepare
> method before any other method. In my case i am trying to call customized
> method before prepare method to set some values. I did set method in my
> struts.xml but it is still calling prepare(). I want this prepare to be
> called after calling my customized method.
> Any help is appreciated.
>
> Thanks
>


int's and OGNL in struts.xml

2010-04-01 Thread Chris Pratt
I'm trying to use the OGNL support in Struts 2.0.14 to set some parameter
values in the jFreeChart plugin's chart result type.  But I keep getting
errors because it appears to be expecting all properties to be Strings, even
if the OGNL doesn't return a String.  I'm using:


  user
  
$...@com.example.config@getInt("reports","frameSelectionRate.width")}
$...@com.example.config@getInt("reports","frameSelectionRate.height")}
  
  404


Where

where com.example.Config.getInt is defined as

public int getInt (String domain,String key);


But when struts tries to instantiate the result I get:

[2010-04-01 10:46:57,785] ERROR {abcOu3jlPU3Rf_9tFPSzs}
DefaultActionInvocation.createResult: There was an exception while
instantiating the result of type org.apache.struts2.dispatcher.ChartResult
Caught OgnlException while setting property 'width' on type
'org.apache.struts2.dispatcher.ChartResult'. - Class: ognl.OgnlRuntime
File: OgnlRuntime.java
Method: callAppropriateMethod
Line: 1206 - ognl/OgnlRuntime.java:1206:-1
at
com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:367)
at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
  .
  .
  .
Caused by: java.lang.NoSuchMethodException:
org.apache.struts2.dispatcher.ChartResult.setWidth(java.lang.String)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1206)
at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1454)
at
ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85)
at
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)


Is there any way to make struts recognize that the value is an int, so it
needs to call setWidth(int)?
  (*Chris*)


SImple question on bypassing prepare

2010-04-01 Thread jayakumar ala
Hi All,
 I am new to struts2 and need small help on how i can bypass calling prepare
method before any other method. In my case i am trying to call customized
method before prepare method to set some values. I did set method in my
struts.xml but it is still calling prepare(). I want this prepare to be
called after calling my customized method.
Any help is appreciated.

Thanks


RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread adam pinder

 
so it looks like your issue is more to do with the child values not being set 
by Struts
 
there have been a few postings about using the [] notation on field names to 
get struts to assign the values properly.
 
in struts1 i found it worked fine, however in struts2 i've not really seen it 
working... in some of my actions i have actually added a method which gets the 
parameter values off the request and populates the objects myself..
 
e.g. look for parameter names starting parent.values and use the parameter 
name/value to construct the correct call to set the object.
 
seems unnecessary as struts2 should handle it, but as i say i couldn't get it 
to do it with arraylists i was using.
 



> From: brgrandj...@live.fr
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> Date: Thu, 1 Apr 2010 15:16:36 +0200
>
>
> Thks a lot Adam it is now more concise:
>
>
>
> Setting params
> Setting params id => [ 1 ]
> Setting params id => [ 1 ] method:saveOrUpdate => [ Submit ] name => [ 
> Parent1 ] parent.values[0].id => [ 2 ] parent.values[0].name => [ Child2 ] 
> parent.values[1].id => [ 1 ] parent.values[1].name => [ Child1 ]
>
>
>
> Error setting value
> ognl.NoSuchPropertyException: java.util.HashSet.0
> at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
> at 
> com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor.getProperty(XWorkCollectionPropertyAccessor.java:80)
> at java.lang.Thread.run(Unknown Source)
> ..
> Error setting value
> ognl.NoSuchPropertyException: java.util.HashSet.0
> at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
> ..
> Error setting value
> ognl.NoSuchPropertyException: java.util.HashSet.1
> at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
> at 
> com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor.getProperty(XWorkCollectionPropertyAccessor.java:80)
> ..
> Error setting value
> ognl.NoSuchPropertyException: java.util.HashSet.1
> at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
> at 
> com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor.getProperty(XWorkCollectionPropertyAccessor.java:80)
> at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
> ..
>
> Setting params
>
> Do u see something wrong??
>
>
>
>
>> From: apin...@hotmail.co.uk
>> To: user@struts.apache.org
>> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
>> Date: Thu, 1 Apr 2010 13:54:58 +0100
>>
>>
>>
>> set the rootlogger to warn
>>
>> log4j.rootLogger=warn, stdout
>>
>> rather than debug
>>
>> you should only get a parameterinterceptor log entry every time you post 
>> something to the server
>>
>> 
>>> From: brgrandj...@live.fr
>>> To: user@struts.apache.org
>>> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
>>> Date: Thu, 1 Apr 2010 14:51:40 +0200
>>>
>>>
>>> thks adam but I got now thousand & thousand of lines
>>>
>>> I am afraid that I won't be able to read its before the end of the world in 
>>> 2012..
>>>
>>>
>>>
>>> I saw very quicky an exception at the beginning..
>>>
>>> How can I limit this huge quantity of lines?
>>>
>>>
>>>
>>> here is my log4j.properties file:
>>>
>>>
>>>
>>> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>>> log4j.appender.stdout.Target=System.out
>>> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>>> log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - 
>>> %m%n
>>> log4j.rootLogger=debug, stdout
>>> log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug
>>>
>>>
>>>
>>>
>>>
>>>
>>>
 From: apin...@hotmail.co.uk
 To: user@struts.apache.org
 Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
 Date: Thu, 1 Apr 2010 12:57:39 +0100




 in log4j.properties file (same location as struts.xml and hibernate config 
 files)

 add

 log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug

 this will output param name/value pairs being posted from your page.



 
> From: brgrandj...@live.fr
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 
> 3
> Date: Thu, 1 Apr 2010 13:54:33 +0200
>
>
> Dear Adam,
>
>
>
> I just added a public Child getValues(int idx) in the Parent class 
> definition but it is never called.
>
>
>
> Could u explain to me where and how can I turn on the 
> parameterinterceptor logging? In the struts.xml file?
>
>
>
> thks a lot
>
>
> bruno
>
>
>
>
>
>> From: apin...@hotmail.co.uk
>> To: user@struts.apache.org
>> Subject: RE: CRUD with a OneToMany associatio

RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread bruno grandjean

Here is my Child class definition:

@Entity
@Table(name="CHILD")
public class Child {
private Long id; 
private String name; 
@Id
@GeneratedValue
@Column(name="CHILD_ID") 
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Column(name="NAME")
public String getName() { 
return name;
}
public void setName(String val) {
name = val;
} 
}

 

and Parent definition:

@Entity
@Table(name="PARENT")
public class Parent {
private Long id;
private String name;
private Set values = new HashSet(); 
@Id
@GeneratedValue
@Column(name="PARENT_ID") 
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Column(name="NAME")
public String getName() { 
return name;
}
public void setName(String val) {
name = val;
} 
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 
@JoinTable(name = "PARENT_CHILD", joinColumns = { @JoinColumn(name = 
"PARENT_ID") }, inverseJoinColumns = { @JoinColumn(name = "CHILD_ID") }) 
public Set getValues() { 
return values;
}
public Child getValues(Long idx) { // NEVER CALLED!
for ( Iterator iter = values.iterator(); iter.hasNext();) {
Child c = (Child) iter.next(); 
if (c.getId() == idx) return c;
} 
return null;
}
public void setValues(Set lst) {
values = lst; 
}
}

 

So I do not understand the ognl.NoSuchPropertyException I got after submission..


 
> From: apin...@hotmail.co.uk
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> Date: Thu, 1 Apr 2010 13:54:58 +0100
> 
> 
> 
> set the rootlogger to warn
> 
> log4j.rootLogger=warn, stdout
> 
> rather than debug
> 
> you should only get a parameterinterceptor log entry every time you post 
> something to the server
> 
> 
> > From: brgrandj...@live.fr
> > To: user@struts.apache.org
> > Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> > Date: Thu, 1 Apr 2010 14:51:40 +0200
> >
> >
> > thks adam but I got now thousand & thousand of lines
> >
> > I am afraid that I won't be able to read its before the end of the world in 
> > 2012..
> >
> >
> >
> > I saw very quicky an exception at the beginning..
> >
> > How can I limit this huge quantity of lines?
> >
> >
> >
> > here is my log4j.properties file:
> >
> >
> >
> > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > log4j.appender.stdout.Target=System.out
> > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - 
> > %m%n
> > log4j.rootLogger=debug, stdout
> > log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug
> >
> >
> >
> >
> >
> >
> >
> >> From: apin...@hotmail.co.uk
> >> To: user@struts.apache.org
> >> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> >> Date: Thu, 1 Apr 2010 12:57:39 +0100
> >>
> >>
> >>
> >>
> >> in log4j.properties file (same location as struts.xml and hibernate config 
> >> files)
> >>
> >> add
> >>
> >> log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug
> >>
> >> this will output param name/value pairs being posted from your page.
> >>
> >>
> >>
> >> 
> >>> From: brgrandj...@live.fr
> >>> To: user@struts.apache.org
> >>> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 
> >>> 3
> >>> Date: Thu, 1 Apr 2010 13:54:33 +0200
> >>>
> >>>
> >>> Dear Adam,
> >>>
> >>>
> >>>
> >>> I just added a public Child getValues(int idx) in the Parent class 
> >>> definition but it is never called.
> >>>
> >>>
> >>>
> >>> Could u explain to me where and how can I turn on the 
> >>> parameterinterceptor logging? In the struts.xml file?
> >>>
> >>>
> >>>
> >>> thks a lot
> >>>
> >>>
> >>> bruno
> >>>
> >>>
> >>>
> >>>
> >>>
>  From: apin...@hotmail.co.uk
>  To: user@struts.apache.org
>  Subject: RE: CRUD with a OneToMany association under Struts 2 / 
>  Hibernate 3
>  Date: Thu, 1 Apr 2010 12:18:48 +0100
> 
> 
> 
> 
>  turn on the parameterinterceptor logging and make sure as mentioned that
> 
>  1) the values you expect for each child are being sent to the server (id 
>  and name)
>  2) the parameter names are correct for setting each child
> 
>  i had some issues getting lists of items to be updated by form 
>  submission alone.
> 
>  for example does your parent object have a getValues method taking an 
>  index value
> 
>  getParent().getValues(1).setId(1)
>  getParent().getValues(1).setName("bob")
> 
>  would be called by parameterinterceptor
> 
> 
>  
> > From: brgrandj...@live.fr
> > To: user@struts.apache.org
> > Subject: RE: CRUD with a OneToMany association under Struts 2 / 
> > Hibernate 3
> > Date: Thu, 1 Apr 2010 12:16:09 +0200
> >
> >
> > Dear René
> >
> >
> >
> > I c

RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread bruno grandjean

Thks a lot Adam it is now more concise:

 

Setting params 
Setting params id => [ 1 ] 
Setting params id => [ 1 ] method:saveOrUpdate => [ Submit ] name => [ Parent1 
] parent.values[0].id => [ 2 ] parent.values[0].name => [ Child2 ] 
parent.values[1].id => [ 1 ] parent.values[1].name => [ Child1 ]

 

Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.0
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
at 
com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor.getProperty(XWorkCollectionPropertyAccessor.java:80)
at java.lang.Thread.run(Unknown Source)
..
Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.0
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
..
Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.1
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
at 
com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor.getProperty(XWorkCollectionPropertyAccessor.java:80)
..
Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.1
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
at 
com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor.getProperty(XWorkCollectionPropertyAccessor.java:80)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
..
 
Setting params 

Do u see something wrong??

 

 
> From: apin...@hotmail.co.uk
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> Date: Thu, 1 Apr 2010 13:54:58 +0100
> 
> 
> 
> set the rootlogger to warn
> 
> log4j.rootLogger=warn, stdout
> 
> rather than debug
> 
> you should only get a parameterinterceptor log entry every time you post 
> something to the server
> 
> 
> > From: brgrandj...@live.fr
> > To: user@struts.apache.org
> > Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> > Date: Thu, 1 Apr 2010 14:51:40 +0200
> >
> >
> > thks adam but I got now thousand & thousand of lines
> >
> > I am afraid that I won't be able to read its before the end of the world in 
> > 2012..
> >
> >
> >
> > I saw very quicky an exception at the beginning..
> >
> > How can I limit this huge quantity of lines?
> >
> >
> >
> > here is my log4j.properties file:
> >
> >
> >
> > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > log4j.appender.stdout.Target=System.out
> > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - 
> > %m%n
> > log4j.rootLogger=debug, stdout
> > log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug
> >
> >
> >
> >
> >
> >
> >
> >> From: apin...@hotmail.co.uk
> >> To: user@struts.apache.org
> >> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> >> Date: Thu, 1 Apr 2010 12:57:39 +0100
> >>
> >>
> >>
> >>
> >> in log4j.properties file (same location as struts.xml and hibernate config 
> >> files)
> >>
> >> add
> >>
> >> log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug
> >>
> >> this will output param name/value pairs being posted from your page.
> >>
> >>
> >>
> >> 
> >>> From: brgrandj...@live.fr
> >>> To: user@struts.apache.org
> >>> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 
> >>> 3
> >>> Date: Thu, 1 Apr 2010 13:54:33 +0200
> >>>
> >>>
> >>> Dear Adam,
> >>>
> >>>
> >>>
> >>> I just added a public Child getValues(int idx) in the Parent class 
> >>> definition but it is never called.
> >>>
> >>>
> >>>
> >>> Could u explain to me where and how can I turn on the 
> >>> parameterinterceptor logging? In the struts.xml file?
> >>>
> >>>
> >>>
> >>> thks a lot
> >>>
> >>>
> >>> bruno
> >>>
> >>>
> >>>
> >>>
> >>>
>  From: apin...@hotmail.co.uk
>  To: user@struts.apache.org
>  Subject: RE: CRUD with a OneToMany association under Struts 2 / 
>  Hibernate 3
>  Date: Thu, 1 Apr 2010 12:18:48 +0100
> 
> 
> 
> 
>  turn on the parameterinterceptor logging and make sure as mentioned that
> 
>  1) the values you expect for each child are being sent to the server (id 
>  and name)
>  2) the parameter names are correct for setting each child
> 
>  i had some issues getting lists of items to be updated by form 
>  submission alone.
> 
>  for example does your parent object have a getValues method taking an 
>  index value
> 
>  getParent().getValues(1).setId(1)
>  getParent().getValues(1).setName("bob")
> 
>  would be called by parameterinterceptor
> 
> 
>  
> > From: brgrandj...@live.fr
> > To: user@struts.apache.org
> > Subject: RE: CRUD with a OneToMany association under Struts 2 / 
> > Hibernate 3
> > Date: Thu, 1 Apr 2010 12:16:09 +0200
> >
> 

RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread bruno grandjean

Here are exceptions I got after submitting:
 


Entering getProperty()
Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.0
...
 


Entering getProperty()
Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.0
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
..


Entering getProperty()
Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.1
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
..


Entering getProperty()
Error setting value
ognl.NoSuchPropertyException: java.util.HashSet.1
at ognl.SetPropertyAccessor.getProperty(SetPropertyAccessor.java:67)
..



Hibernate Validation in class com.metacrud.web.ParentAction
Hibernate Validation found no erros.
Executing action method = saveOrUpdate
Redirecting to finalLocation /Metacrud/listParent
after Locale=fr
intercept } 
processing flush-time cascades
dirty checking collections
Collection found: [com.metacrud.domain.Parent.values#1], was: [] 
(initialized)
Flushed: 0 insertions, 1 updates, 0 deletions to 1 objects
Flushed: 1 (re)creations, 0 updates, 1 removals to 1 collections
listing entities:
com.metacrud.domain.Parent{id=1, values=[], name=Parent1}
about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
update PARENT set NAME=? where PARENT_ID=?
Executing batch size: 1
about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
Deleting collection: [com.metacrud.domain.Parent.values#1]
about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
delete from PARENT_CHILD where PARENT_ID=?
done deleting collection

 

 

 


 
> From: apin...@hotmail.co.uk
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> Date: Thu, 1 Apr 2010 12:57:39 +0100
> 
> 
> 
> 
> in log4j.properties file (same location as struts.xml and hibernate config 
> files)
> 
> add
> 
> log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug
> 
> this will output param name/value pairs being posted from your page.
> 
> 
> 
> 
> > From: brgrandj...@live.fr
> > To: user@struts.apache.org
> > Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> > Date: Thu, 1 Apr 2010 13:54:33 +0200
> >
> >
> > Dear Adam,
> >
> >
> >
> > I just added a public Child getValues(int idx) in the Parent class 
> > definition but it is never called.
> >
> >
> >
> > Could u explain to me where and how can I turn on the parameterinterceptor 
> > logging? In the struts.xml file?
> >
> >
> >
> > thks a lot
> >
> >
> > bruno
> >
> >
> >
> >
> >
> >> From: apin...@hotmail.co.uk
> >> To: user@struts.apache.org
> >> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> >> Date: Thu, 1 Apr 2010 12:18:48 +0100
> >>
> >>
> >>
> >>
> >> turn on the parameterinterceptor logging and make sure as mentioned that
> >>
> >> 1) the values you expect for each child are being sent to the server (id 
> >> and name)
> >> 2) the parameter names are correct for setting each child
> >>
> >> i had some issues getting lists of items to be updated by form submission 
> >> alone.
> >>
> >> for example does your parent object have a getValues method taking an 
> >> index value
> >>
> >> getParent().getValues(1).setId(1)
> >> getParent().getValues(1).setName("bob")
> >>
> >> would be called by parameterinterceptor
> >>
> >>
> >> 
> >>> From: brgrandj...@live.fr
> >>> To: user@struts.apache.org
> >>> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 
> >>> 3
> >>> Date: Thu, 1 Apr 2010 12:16:09 +0200
> >>>
> >>>
> >>> Dear René
> >>>
> >>>
> >>>
> >>> I changed my jsp page so as to integrate the following block:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> which generates the following html code:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> I can display my complete Child Set but I got the same result after 
> >>> updating: my Child Set is empty.
> >>>
> >>>
> >>>
> >>> Is that necessary to modify my ParentAction as well? If yes what to do?
> >>>
> >>>
> >>>
> >>> public class ParentAction extends ActionSupport implements ModelDriven {
> >>>
> >>> private static final long serialVersionUID = -2662966220408285700L;
> >>> private Parent cl = new Parent();
> >>> private List clList = new ArrayList();
> >>> private ParentDAO clDAO = new ParentDAOImpl();
> >>>
> >>> @Override
> >>> public Parent getModel() {
> >>> return cl;
> >>> }
> >>>
> >>> public String saveOrUpdate()
> >>> { // cl.values is empty here!!
> >>> clDAO.saveOrUpdateParent(cl);
> >>> return SUCCESS;
> >>> }
> >>>
> >>> public String save()
> >>> {
> >>> clDAO.saveParent(cl);
> >>> return SUCCESS;
> >>> }
> >>>
> >>> public String list()
> >>> {
> >>> clList = clDAO.listParent();
> >>> return S

RE: Error creating form bean struts 1.2 + weblogic 8.1 + myeclipse 5.5

2010-04-01 Thread adam pinder

 
seems like form definition isn't in struts config file or properly defined


> Date: Thu, 1 Apr 2010 11:45:42 +
> To: user@struts.apache.org
> Subject: Error creating form bean struts 1.2 + weblogic 8.1 + myeclipse 5.5
> From: nanukh...@rediffmail.com
>
> Hi All,
> I am a newbee to struts and trying some hands on it. I was just trying to 
> develop a simple login form but getting following exception on initial run 
> only.
> -
> SEVERE: Error creating form bean of class 
> com.abc.struts.form.LoginFormjava.lang.NullPointerExceptionat 
> org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)at
>  
> org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)at 
> org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)at 
> org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)at 
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)at 
> jsp_servlet.__login._jspService(__login.java:196)at 
> weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
> -
> I tried searching thru all forums from last 2 days but could not found any 
> solution to the issue. This seems to be a very common problem but I don't 
> know why its not going away. I am really stuck up.
> Below are the listing of files required to analyize the cause of error.
> web.xml PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
> "http://java.sun.com/dtd/web-app_2_3.dtd";>  
> action
> org.apache.struts.action.ActionServlet
>   config  
> /WEB-INF/struts-config.xml
>   debug  
> 3  
> detail   &
> nbsp;  3
> 0
> action*.do  
>   
> index.jsp   
> /WEB-INF/struts-html.tld   
> /WEB-INF/struts-html.tld  
> 
> index.jsp-.. page="/home.do">Login  .
> struts-config.xml- encoding="UTF-8"?> Foundation//DTD Struts Configuration 1.2//EN" 
> "http://struts.apache.org/dtds/struts-config_1_2.dtd";>
>  name="loginForm" type="com.siemens.struts.form.LoginForm" />
>   
>  attribute="loginForm"  name="loginForm"  path="/empLogin"  
> scope="request"  type="com.siemens.struts.action.EmpLoginAction"  
> validate="false" />  
>   
>/>
> Login.jsp-
>   
>   Login:  
>   
> Password:  
>align="center">Login&nbs
> p;   
> I can also provide the form bean and action class if required but I believe 
> it won't add to solving the problem as the exception occurs when I click on 
> the link on index.jsp and then it tries to render the Login.jsp.
> Please help.
> Nanu
> 
_
Send us your Hotmail stories and be featured in our newsletter
http://clk.atdmt.com/UKM/go/195013117/direct/01/
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread adam pinder

 
set the rootlogger to warn
 
log4j.rootLogger=warn, stdout

rather than debug
 
you should only get a parameterinterceptor log entry every time you post 
something to the server


> From: brgrandj...@live.fr
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> Date: Thu, 1 Apr 2010 14:51:40 +0200
>
>
> thks adam but I got now thousand & thousand of lines
>
> I am afraid that I won't be able to read its before the end of the world in 
> 2012..
>
>
>
> I saw very quicky an exception at the beginning..
>
> How can I limit this huge quantity of lines?
>
>
>
> here is my log4j.properties file:
>
>
>
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.Target=System.out
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - 
> %m%n
> log4j.rootLogger=debug, stdout
> log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug
>
>
>
>
>
>
>
>> From: apin...@hotmail.co.uk
>> To: user@struts.apache.org
>> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
>> Date: Thu, 1 Apr 2010 12:57:39 +0100
>>
>>
>>
>>
>> in log4j.properties file (same location as struts.xml and hibernate config 
>> files)
>>
>> add
>>
>> log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug
>>
>> this will output param name/value pairs being posted from your page.
>>
>>
>>
>> 
>>> From: brgrandj...@live.fr
>>> To: user@struts.apache.org
>>> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
>>> Date: Thu, 1 Apr 2010 13:54:33 +0200
>>>
>>>
>>> Dear Adam,
>>>
>>>
>>>
>>> I just added a public Child getValues(int idx) in the Parent class 
>>> definition but it is never called.
>>>
>>>
>>>
>>> Could u explain to me where and how can I turn on the parameterinterceptor 
>>> logging? In the struts.xml file?
>>>
>>>
>>>
>>> thks a lot
>>>
>>>
>>> bruno
>>>
>>>
>>>
>>>
>>>
 From: apin...@hotmail.co.uk
 To: user@struts.apache.org
 Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
 Date: Thu, 1 Apr 2010 12:18:48 +0100




 turn on the parameterinterceptor logging and make sure as mentioned that

 1) the values you expect for each child are being sent to the server (id 
 and name)
 2) the parameter names are correct for setting each child

 i had some issues getting lists of items to be updated by form submission 
 alone.

 for example does your parent object have a getValues method taking an 
 index value

 getParent().getValues(1).setId(1)
 getParent().getValues(1).setName("bob")

 would be called by parameterinterceptor


 
> From: brgrandj...@live.fr
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 
> 3
> Date: Thu, 1 Apr 2010 12:16:09 +0200
>
>
> Dear René
>
>
>
> I changed my jsp page so as to integrate the following block:
>
>
>
>
>
>
>
>
>
>
> which generates the following html code:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I can display my complete Child Set but I got the same result after 
> updating: my Child Set is empty.
>
>
>
> Is that necessary to modify my ParentAction as well? If yes what to do?
>
>
>
> public class ParentAction extends ActionSupport implements ModelDriven {
>
> private static final long serialVersionUID = -2662966220408285700L;
> private Parent cl = new Parent();
> private List clList = new ArrayList();
> private ParentDAO clDAO = new ParentDAOImpl();
>
> @Override
> public Parent getModel() {
> return cl;
> }
>
> public String saveOrUpdate()
> { // cl.values is empty here!!
> clDAO.saveOrUpdateParent(cl);
> return SUCCESS;
> }
>
> public String save()
> {
> clDAO.saveParent(cl);
> return SUCCESS;
> }
>
> public String list()
> {
> clList = clDAO.listParent();
> return SUCCESS;
> }
>
> public String delete()
> {
> HttpServletRequest request = (HttpServletRequest) 
> ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
> clDAO.deleteParent(Long.parseLong(request.getParameter("id")));
> return SUCCESS;
> }
>
> public String edit()
> { // cl.values contains some valid Child elements here!!
> HttpServletRequest request = (HttpServletRequest) 
> ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
> cl = clDAO.listParentById(Long.

RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread bruno grandjean

thks adam but I got now thousand & thousand of lines

I am afraid that I won't be able to read its before the end of the world in 
2012..

 

I saw very quicky an exception at the beginning.. 

How can I limit this huge quantity of lines?

 

here is my log4j.properties file:

 

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=debug, stdout
log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug

 

 


 
> From: apin...@hotmail.co.uk
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> Date: Thu, 1 Apr 2010 12:57:39 +0100
> 
> 
> 
> 
> in log4j.properties file (same location as struts.xml and hibernate config 
> files)
> 
> add
> 
> log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug
> 
> this will output param name/value pairs being posted from your page.
> 
> 
> 
> 
> > From: brgrandj...@live.fr
> > To: user@struts.apache.org
> > Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> > Date: Thu, 1 Apr 2010 13:54:33 +0200
> >
> >
> > Dear Adam,
> >
> >
> >
> > I just added a public Child getValues(int idx) in the Parent class 
> > definition but it is never called.
> >
> >
> >
> > Could u explain to me where and how can I turn on the parameterinterceptor 
> > logging? In the struts.xml file?
> >
> >
> >
> > thks a lot
> >
> >
> > bruno
> >
> >
> >
> >
> >
> >> From: apin...@hotmail.co.uk
> >> To: user@struts.apache.org
> >> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> >> Date: Thu, 1 Apr 2010 12:18:48 +0100
> >>
> >>
> >>
> >>
> >> turn on the parameterinterceptor logging and make sure as mentioned that
> >>
> >> 1) the values you expect for each child are being sent to the server (id 
> >> and name)
> >> 2) the parameter names are correct for setting each child
> >>
> >> i had some issues getting lists of items to be updated by form submission 
> >> alone.
> >>
> >> for example does your parent object have a getValues method taking an 
> >> index value
> >>
> >> getParent().getValues(1).setId(1)
> >> getParent().getValues(1).setName("bob")
> >>
> >> would be called by parameterinterceptor
> >>
> >>
> >> 
> >>> From: brgrandj...@live.fr
> >>> To: user@struts.apache.org
> >>> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 
> >>> 3
> >>> Date: Thu, 1 Apr 2010 12:16:09 +0200
> >>>
> >>>
> >>> Dear René
> >>>
> >>>
> >>>
> >>> I changed my jsp page so as to integrate the following block:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> which generates the following html code:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> I can display my complete Child Set but I got the same result after 
> >>> updating: my Child Set is empty.
> >>>
> >>>
> >>>
> >>> Is that necessary to modify my ParentAction as well? If yes what to do?
> >>>
> >>>
> >>>
> >>> public class ParentAction extends ActionSupport implements ModelDriven {
> >>>
> >>> private static final long serialVersionUID = -2662966220408285700L;
> >>> private Parent cl = new Parent();
> >>> private List clList = new ArrayList();
> >>> private ParentDAO clDAO = new ParentDAOImpl();
> >>>
> >>> @Override
> >>> public Parent getModel() {
> >>> return cl;
> >>> }
> >>>
> >>> public String saveOrUpdate()
> >>> { // cl.values is empty here!!
> >>> clDAO.saveOrUpdateParent(cl);
> >>> return SUCCESS;
> >>> }
> >>>
> >>> public String save()
> >>> {
> >>> clDAO.saveParent(cl);
> >>> return SUCCESS;
> >>> }
> >>>
> >>> public String list()
> >>> {
> >>> clList = clDAO.listParent();
> >>> return SUCCESS;
> >>> }
> >>>
> >>> public String delete()
> >>> {
> >>> HttpServletRequest request = (HttpServletRequest) 
> >>> ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
> >>> clDAO.deleteParent(Long.parseLong(request.getParameter("id")));
> >>> return SUCCESS;
> >>> }
> >>>
> >>> public String edit()
> >>> { // cl.values contains some valid Child elements here!!
> >>> HttpServletRequest request = (HttpServletRequest) 
> >>> ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
> >>> cl = clDAO.listParentById(Long.parseLong(request.getParameter("id")));
> >>> }
> >>> return SUCCESS;
> >>> }
> >>>
> >>> public Parent getParent() {
> >>> return cl;
> >>> }
> >>>
> >>> public void setParent(Parent cl) {
> >>> this.cl = cl;
> >>> }
> >>>
> >>> public List getParentList() {
> >>> return clList;
> >>> }
> >>>
> >>> public void setParentList(List clList) {
> >>> this.clList = clList;
> >>> }
> >>> }
> >>>
> >>>
> >>>
>  Date: Thu, 1 Apr 2010 11:30:23 +0200

Error creating form bean - struts 1.2 + weblogic 8.1 + myeclipse 5.5

2010-04-01 Thread Vivek Gupta
Hi All,

I am a newbee to struts and trying some hands on it. I was just trying to
develop a simple login form but getting following exception on initial run
only.

-

SEVERE: Error creating form bean of class com.abc.struts.form.LoginForm
java.lang.NullPointerException
at
org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)
at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)
at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)
at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)
at jsp_servlet.__login._jspService(__login.java:196)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)

-

I tried searching thru all forums from last 2 days but could not found any
solution to the issue. This seems to be a very common problem but I don't
know why its not going away. I am really stuck up.

Below are the listing of files required to analyize the cause of error.

web.xml


http://java.sun.com/dtd/web-app_2_3.dtd";>

  
action
org.apache.struts.action.ActionServlet

  config
  /WEB-INF/struts-config.xml


  debug
  3


  detail
  3

0
  
  
action
*.do
  
  
index.jsp
  
  
   /WEB-INF/struts-html.tld
   /WEB-INF/struts-html.tld
  



index.jsp
-
..

Login
  
.


struts-config.xml
-

http://struts.apache.org/dtds/struts-config_1_2.dtd
">


  
  


  

  
  
  




  

  



Login.jsp
-



  

  Login:
  


  Password:
  


  Login

  

  

I can also provide the form bean and action class if required but I believe
it won't add to solving the problem as the exception occurs when I click on
the link on index.jsp and then it tries to render the Login.jsp.

Please help.

Nanu


Error creating form bean - struts 1.2 + weblogic 8.1 + myeclipse 5.5

2010-04-01 Thread nanukhota
Hi All,
I am a newbee to struts and trying some hands on it. I was just trying to 
develop a simple login form but getting following exception on initial run only.
-
SEVERE: Error creating form bean of class 
com.abc.struts.form.LoginFormjava.lang.NullPointerExceptionat 
org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)at
 org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)at 
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)at 
org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)at 
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)at 
jsp_servlet.__login._jspService(__login.java:196)at 
weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
-
I tried searching thru all forums from last 2 days but could not found any 
solution to the issue. This seems to be a very common problem but I don't know 
why its not going away. I am really stuck up.
Below are the listing of files required to analyize the cause of error.
web.xmlhttp://java.sun.com/dtd/web-app_2_3.dtd">actionorg.apache.struts.action.ActionServletconfig/WEB-INF/struts-config.xmldebug3detail30action*.doindex.jsp/WEB-INF/struts-html.tld/WEB-INF/struts-html.tld
index.jsp-..Login.
struts-config.xml-http://struts.apache.org/dtds/struts-config_1_2.dtd">;




Error creating form bean struts 1.2 + weblogic 8.1 + myeclipse 5.5

2010-04-01 Thread Nanu Khota
Hi All,
I am a newbee to struts and trying some hands on it. I was just trying to 
develop a simple login form but getting following exception on initial run only.
-
SEVERE: Error creating form bean of class 
com.abc.struts.form.LoginFormjava.lang.NullPointerExceptionat 
org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)at
 org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)at 
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)at 
org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)at 
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)at 
jsp_servlet.__login._jspService(__login.java:196)at 
weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
-
I tried searching thru all forums from last 2 days but could not found any 
solution to the issue. This seems to be a very common problem but I don't know 
why its not going away. I am really stuck up.
Below are the listing of files required to analyize the cause of error.
web.xml ; 
    
action    
org.apache.struts.action.ActionServlet   
   
config  
/WEB-INF/struts-config.xml   
     
  
debug  
3    
    
  
detail   &
 nbsp;  3    
    
0    
    
action    
*.do  
      
index.jsp  
    
 /WEB-INF/struts-html.tld  
 /WEB-INF/struts-html.tld 
 
index.jsp-..    Login  .
struts-config.xml-;
        
  
      
    
      

  
  
Login.jsp-
          
  
 
     
    
  
 
     
    
  &nbs
 p;     
Login:
Password:
Login
   
  I can also provide the form bean and action class if required but I believe it won't add to solving the problem as the exception occurs when I click on the link on index.jsp and then it tries to render the Login.jsp. Please help. Nanu  

RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread adam pinder

 
 
in log4j.properties file (same location as struts.xml and hibernate config 
files)
 
add
 
log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=debug
 
this will output param name/value pairs being posted from your page.
 



> From: brgrandj...@live.fr
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> Date: Thu, 1 Apr 2010 13:54:33 +0200
>
>
> Dear Adam,
>
>
>
> I just added a public Child getValues(int idx) in the Parent class definition 
> but it is never called.
>
>
>
> Could u explain to me where and how can I turn on the parameterinterceptor 
> logging? In the struts.xml file?
>
>
>
> thks a lot
>
>
> bruno
>
>
>
>
>
>> From: apin...@hotmail.co.uk
>> To: user@struts.apache.org
>> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
>> Date: Thu, 1 Apr 2010 12:18:48 +0100
>>
>>
>>
>>
>> turn on the parameterinterceptor logging and make sure as mentioned that
>>
>> 1) the values you expect for each child are being sent to the server (id and 
>> name)
>> 2) the parameter names are correct for setting each child
>>
>> i had some issues getting lists of items to be updated by form submission 
>> alone.
>>
>> for example does your parent object have a getValues method taking an index 
>> value
>>
>> getParent().getValues(1).setId(1)
>> getParent().getValues(1).setName("bob")
>>
>> would be called by parameterinterceptor
>>
>>
>> 
>>> From: brgrandj...@live.fr
>>> To: user@struts.apache.org
>>> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
>>> Date: Thu, 1 Apr 2010 12:16:09 +0200
>>>
>>>
>>> Dear René
>>>
>>>
>>>
>>> I changed my jsp page so as to integrate the following block:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> which generates the following html code:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> I can display my complete Child Set but I got the same result after 
>>> updating: my Child Set is empty.
>>>
>>>
>>>
>>> Is that necessary to modify my ParentAction as well? If yes what to do?
>>>
>>>
>>>
>>> public class ParentAction extends ActionSupport implements ModelDriven {
>>>
>>> private static final long serialVersionUID = -2662966220408285700L;
>>> private Parent cl = new Parent();
>>> private List clList = new ArrayList();
>>> private ParentDAO clDAO = new ParentDAOImpl();
>>>
>>> @Override
>>> public Parent getModel() {
>>> return cl;
>>> }
>>>
>>> public String saveOrUpdate()
>>> { // cl.values is empty here!!
>>> clDAO.saveOrUpdateParent(cl);
>>> return SUCCESS;
>>> }
>>>
>>> public String save()
>>> {
>>> clDAO.saveParent(cl);
>>> return SUCCESS;
>>> }
>>>
>>> public String list()
>>> {
>>> clList = clDAO.listParent();
>>> return SUCCESS;
>>> }
>>>
>>> public String delete()
>>> {
>>> HttpServletRequest request = (HttpServletRequest) 
>>> ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
>>> clDAO.deleteParent(Long.parseLong(request.getParameter("id")));
>>> return SUCCESS;
>>> }
>>>
>>> public String edit()
>>> { // cl.values contains some valid Child elements here!!
>>> HttpServletRequest request = (HttpServletRequest) 
>>> ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
>>> cl = clDAO.listParentById(Long.parseLong(request.getParameter("id")));
>>> }
>>> return SUCCESS;
>>> }
>>>
>>> public Parent getParent() {
>>> return cl;
>>> }
>>>
>>> public void setParent(Parent cl) {
>>> this.cl = cl;
>>> }
>>>
>>> public List getParentList() {
>>> return clList;
>>> }
>>>
>>> public void setParentList(List clList) {
>>> this.clList = clList;
>>> }
>>> }
>>>
>>>
>>>
 Date: Thu, 1 Apr 2010 11:30:23 +0200
 From: gie...@it-neering.net
 To: user@struts.apache.org
 Subject: Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3

 Given the model you presented in the first post, your problem seems to
 be that the posted values have not the correct name for the children's
 form fields. The parameters names you would need are

 id
 name
 values[0].id
 values[0].name
 values[1].id
 values[2].name
 ...

 for the parameters interceptor to work properly when applying the posted
 values.

 See here for more details:
 http://struts.apache.org/2.1.8/docs/tabular-inputs.html

 - René

 bruno grandjean schrieb:
> Dear Rene,
>
> Thks a lot for replying to me because I am feeling a little bit alone with
> my CRUD ;-). In fact I am trying to build a dynamic MetaCrud.
> My pb is simple: in the same jsp page I would like to update a Parent
> object
> and its Childs (values):
>
>
>
 name="name" label="Nom" />
>
>
>
>
>
>
>
>
>
> From an existing Parent object with many Childs objects I can easily 
> modify
>

RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread bruno grandjean

Dear Adam,

 

I just added a public Child getValues(int idx) in the Parent class definition 
but it is never called.

 

Could u explain to me where and how can I turn on the parameterinterceptor 
logging? In the struts.xml file?

 

thks a lot


bruno

 


 
> From: apin...@hotmail.co.uk
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> Date: Thu, 1 Apr 2010 12:18:48 +0100
> 
> 
> 
> 
> turn on the parameterinterceptor logging and make sure as mentioned that 
> 
> 1) the values you expect for each child are being sent to the server (id and 
> name)
> 2) the parameter names are correct for setting each child
> 
> i had some issues getting lists of items to be updated by form submission 
> alone.
> 
> for example does your parent object have a getValues method taking an index 
> value
> 
> getParent().getValues(1).setId(1)
> getParent().getValues(1).setName("bob")
> 
> would be called by parameterinterceptor
> 
> 
> 
> > From: brgrandj...@live.fr
> > To: user@struts.apache.org
> > Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> > Date: Thu, 1 Apr 2010 12:16:09 +0200
> >
> >
> > Dear René
> >
> >
> >
> > I changed my jsp page so as to integrate the following block:
> >
> >
> >
> > 
> > 
> > 
> > 
> >
> >
> >
> > which generates the following html code:
> >
> >
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> >
> > I can display my complete Child Set but I got the same result after 
> > updating: my Child Set is empty.
> >
> >
> >
> > Is that necessary to modify my ParentAction as well? If yes what to do?
> >
> >
> >
> > public class ParentAction extends ActionSupport implements ModelDriven {
> >
> > private static final long serialVersionUID = -2662966220408285700L;
> > private Parent cl = new Parent();
> > private List clList = new ArrayList();
> > private ParentDAO clDAO = new ParentDAOImpl();
> >
> > @Override
> > public Parent getModel() {
> > return cl;
> > }
> >
> > public String saveOrUpdate()
> > { // cl.values is empty here!!
> > clDAO.saveOrUpdateParent(cl);
> > return SUCCESS;
> > }
> >
> > public String save()
> > {
> > clDAO.saveParent(cl);
> > return SUCCESS;
> > }
> >
> > public String list()
> > {
> > clList = clDAO.listParent();
> > return SUCCESS;
> > }
> >
> > public String delete()
> > {
> > HttpServletRequest request = (HttpServletRequest) 
> > ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
> > clDAO.deleteParent(Long.parseLong(request.getParameter("id")));
> > return SUCCESS;
> > }
> >
> > public String edit()
> > { // cl.values contains some valid Child elements here!!
> > HttpServletRequest request = (HttpServletRequest) 
> > ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
> > cl = clDAO.listParentById(Long.parseLong(request.getParameter("id")));
> > }
> > return SUCCESS;
> > }
> >
> > public Parent getParent() {
> > return cl;
> > }
> >
> > public void setParent(Parent cl) {
> > this.cl = cl;
> > }
> >
> > public List getParentList() {
> > return clList;
> > }
> >
> > public void setParentList(List clList) {
> > this.clList = clList;
> > }
> > }
> >
> >
> >
> >> Date: Thu, 1 Apr 2010 11:30:23 +0200
> >> From: gie...@it-neering.net
> >> To: user@struts.apache.org
> >> Subject: Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> >>
> >> Given the model you presented in the first post, your problem seems to
> >> be that the posted values have not the correct name for the children's
> >> form fields. The parameters names you would need are
> >>
> >> id
> >> name
> >> values[0].id
> >> values[0].name
> >> values[1].id
> >> values[2].name
> >> ...
> >>
> >> for the parameters interceptor to work properly when applying the posted
> >> values.
> >>
> >> See here for more details:
> >> http://struts.apache.org/2.1.8/docs/tabular-inputs.html
> >>
> >> - René
> >>
> >> bruno grandjean schrieb:
> >>> Dear Rene,
> >>>
> >>> Thks a lot for replying to me because I am feeling a little bit alone with
> >>> my CRUD ;-). In fact I am trying to build a dynamic MetaCrud.
> >>> My pb is simple: in the same jsp page I would like to update a Parent
> >>> object
> >>> and its Childs (values):
> >>>
> >>> 
> >>> 
> >> name="name" label="Nom" />
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>>
> >>> From an existing Parent object with many Childs objects I can easily 
> >>> modify
> >>> parent.name for instance but the collection of Child objects (values) is
> >>> always empty in the ParentAction (saveOrUpdate() method) after submitting.
> >>> However I can display each values[i].name in the jsp page with the correct
> >>> value.
> >>> So it is not an issue with Hibernate but with the jsp or ModelDriven
> >>> interface I don't know..Do you have any idea?
> >>> Basically I was not able to find a struts or spring documentation about
> >>> CRUD
> >>> & asso

RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread adam pinder

 
 
turn on the parameterinterceptor logging and make sure as mentioned that 
 
1) the values you expect for each child are being sent to the server (id and 
name)
2) the parameter names are correct for setting each child
 
i had some issues getting lists of items to be updated by form submission alone.
 
for example does your parent object have a getValues method taking an index 
value
 
getParent().getValues(1).setId(1)
getParent().getValues(1).setName("bob")
 
would be called by parameterinterceptor



> From: brgrandj...@live.fr
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> Date: Thu, 1 Apr 2010 12:16:09 +0200
>
>
> Dear René
>
>
>
> I changed my jsp page so as to integrate the following block:
>
>
>
> 
> 
> 
> 
>
>
>
> which generates the following html code:
>
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
> I can display my complete Child Set but I got the same result after updating: 
> my Child Set is empty.
>
>
>
> Is that necessary to modify my ParentAction as well? If yes what to do?
>
>
>
> public class ParentAction extends ActionSupport implements ModelDriven {
>
> private static final long serialVersionUID = -2662966220408285700L;
> private Parent cl = new Parent();
> private List clList = new ArrayList();
> private ParentDAO clDAO = new ParentDAOImpl();
>
> @Override
> public Parent getModel() {
> return cl;
> }
>
> public String saveOrUpdate()
> { // cl.values is empty here!!
> clDAO.saveOrUpdateParent(cl);
> return SUCCESS;
> }
>
> public String save()
> {
> clDAO.saveParent(cl);
> return SUCCESS;
> }
>
> public String list()
> {
> clList = clDAO.listParent();
> return SUCCESS;
> }
>
> public String delete()
> {
> HttpServletRequest request = (HttpServletRequest) 
> ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
> clDAO.deleteParent(Long.parseLong(request.getParameter("id")));
> return SUCCESS;
> }
>
> public String edit()
> { // cl.values contains some valid Child elements here!!
> HttpServletRequest request = (HttpServletRequest) 
> ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
> cl = clDAO.listParentById(Long.parseLong(request.getParameter("id")));
> }
> return SUCCESS;
> }
>
> public Parent getParent() {
> return cl;
> }
>
> public void setParent(Parent cl) {
> this.cl = cl;
> }
>
> public List getParentList() {
> return clList;
> }
>
> public void setParentList(List clList) {
> this.clList = clList;
> }
> }
>
>
>
>> Date: Thu, 1 Apr 2010 11:30:23 +0200
>> From: gie...@it-neering.net
>> To: user@struts.apache.org
>> Subject: Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3
>>
>> Given the model you presented in the first post, your problem seems to
>> be that the posted values have not the correct name for the children's
>> form fields. The parameters names you would need are
>>
>> id
>> name
>> values[0].id
>> values[0].name
>> values[1].id
>> values[2].name
>> ...
>>
>> for the parameters interceptor to work properly when applying the posted
>> values.
>>
>> See here for more details:
>> http://struts.apache.org/2.1.8/docs/tabular-inputs.html
>>
>> - René
>>
>> bruno grandjean schrieb:
>>> Dear Rene,
>>>
>>> Thks a lot for replying to me because I am feeling a little bit alone with
>>> my CRUD ;-). In fact I am trying to build a dynamic MetaCrud.
>>> My pb is simple: in the same jsp page I would like to update a Parent
>>> object
>>> and its Childs (values):
>>>
>>> 
>>> 
>> name="name" label="Nom" />
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>> From an existing Parent object with many Childs objects I can easily modify
>>> parent.name for instance but the collection of Child objects (values) is
>>> always empty in the ParentAction (saveOrUpdate() method) after submitting.
>>> However I can display each values[i].name in the jsp page with the correct
>>> value.
>>> So it is not an issue with Hibernate but with the jsp or ModelDriven
>>> interface I don't know..Do you have any idea?
>>> Basically I was not able to find a struts or spring documentation about
>>> CRUD
>>> & association between two entities on the same jsp page.
>>> best regards
>>> bruno
>>>
>>>
>>>
>>> --
>>> From: "Rene Gielen" 
>>> Sent: Wednesday, March 31, 2010 7:12 PM
>>> To: "Struts Users Mailing List" 
>>> Subject: Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3
>>>
 I'm not sure if I understand what your actual question is, nor whether
 it is particularly Struts 2 related (rather than just Hibernate) - but
 you might want to have a look in the CRUD demo section of the Struts 2
 showcase application. Maybe you will also find this demo useful:
 http://github.com/rgielen/struts2crudevolutiondemo

 - René

 bruno grandjean schrieb:
> Hi
>
> I am trying to implement a simple CRUD with a OneToMany association
> under St

RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread bruno grandjean

Dear René

 

I changed my jsp page so as to integrate the following block:

 



 


 

which generates the following html code:

 









  












  

I can display my complete Child Set but I got the same result after updating: 
my Child Set is empty.

 

Is that necessary to modify my ParentAction as well? If yes what to do?

 

public class ParentAction extends ActionSupport implements ModelDriven {

private static final long serialVersionUID = -2662966220408285700L;
private Parent cl = new Parent();
private List clList = new ArrayList(); 
private ParentDAO clDAO = new ParentDAOImpl();

@Override
public Parent getModel() {
return cl;
}

public String saveOrUpdate()
{ // cl.values is empty here!!
clDAO.saveOrUpdateParent(cl); 
return SUCCESS;
}

public String save()
{ 
clDAO.saveParent(cl); 
return SUCCESS;
}

public String list()
{
clList = clDAO.listParent();
return SUCCESS;
}

public String delete()
{
HttpServletRequest request = (HttpServletRequest) 
ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
clDAO.deleteParent(Long.parseLong(request.getParameter("id")));
return SUCCESS;
}

public String edit()
{ // cl.values contains some valid Child elements here!!
HttpServletRequest request = (HttpServletRequest) 
ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
cl = clDAO.listParentById(Long.parseLong(request.getParameter("id")));
} 
return SUCCESS;
}

public Parent getParent() {
return cl;
}

public void setParent(Parent cl) {
this.cl = cl;
}

public List getParentList() {
return clList;
}

public void setParentList(List clList) {
this.clList = clList;
}
}


 
> Date: Thu, 1 Apr 2010 11:30:23 +0200
> From: gie...@it-neering.net
> To: user@struts.apache.org
> Subject: Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> 
> Given the model you presented in the first post, your problem seems to
> be that the posted values have not the correct name for the children's
> form fields. The parameters names you would need are
> 
> id
> name
> values[0].id
> values[0].name
> values[1].id
> values[2].name
> ...
> 
> for the parameters interceptor to work properly when applying the posted
> values.
> 
> See here for more details:
> http://struts.apache.org/2.1.8/docs/tabular-inputs.html
> 
> - René
> 
> bruno grandjean schrieb:
> > Dear Rene,
> > 
> > Thks a lot for replying to me because I am feeling a little bit alone with
> > my CRUD ;-). In fact I am trying to build a dynamic MetaCrud.
> > My pb is simple: in the same jsp page I would like to update a Parent
> > object
> > and its Childs (values):
> > 
> > 
> > 
> >   > name="name" label="Nom" />
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > From an existing Parent object with many Childs objects I can easily modify
> > parent.name for instance but the collection of Child objects (values) is
> > always empty in the ParentAction (saveOrUpdate() method) after submitting.
> > However I can display each values[i].name in the jsp page with the correct
> > value.
> > So it is not an issue with Hibernate but with the jsp or ModelDriven
> > interface I don't know..Do you have any idea?
> > Basically I was not able to find a struts or spring documentation about
> > CRUD
> > & association between two entities on the same jsp page.
> > best regards
> > bruno
> > 
> > 
> > 
> > --
> > From: "Rene Gielen" 
> > Sent: Wednesday, March 31, 2010 7:12 PM
> > To: "Struts Users Mailing List" 
> > Subject: Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> > 
> >> I'm not sure if I understand what your actual question is, nor whether
> >> it is particularly Struts 2 related (rather than just Hibernate) - but
> >> you might want to have a look in the CRUD demo section of the Struts 2
> >> showcase application. Maybe you will also find this demo useful:
> >> http://github.com/rgielen/struts2crudevolutiondemo
> >>
> >> - René
> >>
> >> bruno grandjean schrieb:
> >>> Hi
> >>>
> >>> I am trying to implement a simple CRUD with a OneToMany association
> >>> under Struts 2 / Hibernate 3.
> >>> I have two entities Parent and Child:
> >>>
> >>> @Entity
> >>> @Table(name="PARENT")
> >>> public class Parent {
> >>> private Long id;
> >>> private Set values = new HashSet();
> >>> ..
> >>> @Entity
> >>> @Table(name="CHILD")
> >>> public class Child {
> >>> private Long id;
> >>> private String name;
> >>> ..
> >>>
> >>> I can easily create, delete Parent or read the Child Set (values) but
> >>> it is impossible to update Child Set.
> >>> The jsp page (see below) reinit the values Set, no record after
> >>> updating!
> >>> Could u explain to me what's wrong?
> >>>
> >>> here are my code:
> >>>
> >>> @Entity
> >>> @Table(name="PARENT")
> >>> public class Parent {
> >>> private Long id;
> >>> private Set values = new HashSet();
> >>> @Id
> >>> @GeneratedValue
> >>> @Column(name="PARENT_ID")
> >>> public Long getId() {
> >>> return id;
> >>> }
> >>> public void setId(Long 

Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread Rene Gielen
Given the model you presented in the first post, your problem seems to
be that the posted values have not the correct name for the children's
form fields. The parameters names you would need are

id
name
values[0].id
values[0].name
values[1].id
values[2].name
...

for the parameters interceptor to work properly when applying the posted
values.

See here for more details:
http://struts.apache.org/2.1.8/docs/tabular-inputs.html

- René

bruno grandjean schrieb:
> Dear Rene,
> 
> Thks a lot for replying to me because I am feeling a little bit alone with
> my CRUD ;-). In fact I am trying to build a dynamic MetaCrud.
> My pb is simple: in the same jsp page I would like to update a Parent
> object
> and its Childs (values):
> 
> 
> 
>   name="name" label="Nom" />
> 
>  
>
>
> 
> 
> 
> 
> 
> From an existing Parent object with many Childs objects I can easily modify
> parent.name for instance but the collection of Child objects (values) is
> always empty in the ParentAction (saveOrUpdate() method) after submitting.
> However I can display each values[i].name in the jsp page with the correct
> value.
> So it is not an issue with Hibernate but with the jsp or ModelDriven
> interface I don't know..Do you have any idea?
> Basically I was not able to find a struts or spring documentation about
> CRUD
> & association between two entities on the same jsp page.
> best regards
> bruno
> 
> 
> 
> --
> From: "Rene Gielen" 
> Sent: Wednesday, March 31, 2010 7:12 PM
> To: "Struts Users Mailing List" 
> Subject: Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> 
>> I'm not sure if I understand what your actual question is, nor whether
>> it is particularly Struts 2 related (rather than just Hibernate) - but
>> you might want to have a look in the CRUD demo section of the Struts 2
>> showcase application. Maybe you will also find this demo useful:
>> http://github.com/rgielen/struts2crudevolutiondemo
>>
>> - René
>>
>> bruno grandjean schrieb:
>>> Hi
>>>
>>> I am trying to implement a simple CRUD with a OneToMany association
>>> under Struts 2 / Hibernate 3.
>>> I have two entities Parent and Child:
>>>
>>> @Entity
>>> @Table(name="PARENT")
>>> public class Parent {
>>>  private Long id;
>>>  private Set values = new HashSet();
>>> ..
>>> @Entity
>>> @Table(name="CHILD")
>>> public class Child {
>>>  private Long id;
>>>  private String name;
>>> ..
>>>
>>> I can easily create, delete Parent or read the Child Set (values) but
>>> it is impossible to update Child Set.
>>> The jsp page (see below) reinit the values Set, no record after
>>> updating!
>>> Could u explain to me what's wrong?
>>>
>>> here are my code:
>>>
>>> @Entity
>>> @Table(name="PARENT")
>>> public class Parent {
>>>  private Long id;
>>>  private Set values = new HashSet();
>>>  @Id
>>>  @GeneratedValue
>>>  @Column(name="PARENT_ID")
>>>  public Long getId() {
>>>   return id;
>>>  }
>>>  public void setId(Long id) {
>>>   this.id = id;
>>>  }
>>>  @ManyToMany(fetch = FetchType.EAGER)
>>>  @JoinTable(name = "PARENT_CHILD", joinColumns = { @JoinColumn(name =
>>> "PARENT_ID") }, inverseJoinColumns = { @JoinColumn(name = "CHILD_ID") })
>>>  public Set getValues() {
>>>   return values;
>>>  }
>>>  public void setValues(Set lst) {
>>>   values = lst;
>>>  }
>>> }
>>>
>>> @Entity
>>> @Table(name="CHILD")
>>> public class Child {
>>>  private Long id;
>>>  private String name;
>>>  @Id
>>>  @GeneratedValue
>>>  @Column(name="CHILD_ID")
>>>  public Long getId() {
>>>   return id;
>>>  }
>>>  public void setId(Long id) {
>>>   this.id = id;
>>>  }
>>>  @Column(name="NAME")
>>>  public String getName() {
>>>   return name;
>>>  }
>>>  public void setName(String val) {
>>>   name = val;
>>>  }
>>> }
>>>
>>> public interface ParentDAO {
>>>  public void saveOrUpdateParent(Parent cl);
>>>  public void saveParent(Parent cl);
>>>  public List listParent();
>>>  public Parent listParentById(Long clId);
>>>  public void deleteParent(Long clId);
>>> }
>>>
>>> public class ParentDAOImpl implements ParentDAO {
>>>  @SessionTarget
>>>  Session session;
>>>  @TransactionTarget
>>>  Transaction transaction;
>>>
>>>  @Override
>>>  public void saveOrUpdateParent(Parent cl) {
>>>   try {
>>>session.saveOrUpdate(cl);
>>>   } catch (Exception e) {
>>>transaction.rollback();
>>>e.printStackTrace();
>>>   }
>>>  }
>>>
>>>  @Override
>>>  public void saveParent(Parent cl) {
>>>   try {
>>>session.save(cl);
>>>   } catch (Exception e) {
>>>transaction.rollback();
>>>e.printStackTrace();
>>>   }
>>>  }
>>>
>>>  @Override
>>>  public void deleteParent(Long clId) {
>>>   try {
>>>Parent cl = (Parent) session.get(Parent.class, clId);
>>>session.delete(cl);
>>>   } catch (Exception e) {
>>>transaction.rollback();
>>>e.printStackTrace();
>>>   }
>>>  }
>>>
>>>  @SuppressWarnings("unchecked")
>>>  @Override
>>>  public List listParent() {
>>>   List course

RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3

2010-04-01 Thread bruno grandjean

Dear Adam,
 
I wrote a CascadeType.ALL in my @OneToMany annotation:
 

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 
@JoinTable(name = "PARENT_CHILD", joinColumns = { @JoinColumn(name = 
"PARENT_ID") }, inverseJoinColumns = { @JoinColumn(name = "CHILD_ID") }) 
public Set getValues() { 
return values;}
 
but I got unfortunately the same result.
 
Before running the application I execute the following hsqldb script:
 
insert into CHILD (CHILD_ID, NAME) values (1, 'Child1');
insert into CHILD (CHILD_ID, NAME) values (2, 'Child2');
insert into PARENT (PARENT_ID, NAME) values (1, 'Parent1');
insert into PARENT_CHILD (PARENT_ID, CHILD_ID) values (1, 1);
insert into PARENT_CHILD (PARENT_ID, CHILD_ID) values (1, 2);

After that, in the jsp page I have no pb to modify the fields:
 
1
Nom: Parent1
Id: 1
Nom: Child1
Id: 2
Nom: Child 2

s:form action="saveOrUpdateParent">


 















 
I do not modify any keys which are auto-generated with Hibernate annotations:

 

@Id
@GeneratedValue


Iin debug mode just after clicking the submit button the size of Child Set is 
0, I lost all my Child objects which is abnormal.
After running the session.saveOrUpdate(parent) method the hibernate trace is:
 


Hibernate: update PARENT set NAME=? where PARENT_ID=?
Hibernate: delete from PARENT_CHILD where PARENT_ID=?
 
So I am little bit lost because I do not know how to keep my Child Set alive..

 

All the best

 

Bruno


 
> From: apin...@hotmail.co.uk
> To: user@struts.apache.org
> Subject: RE: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> Date: Thu, 1 Apr 2010 07:46:59 +0100
> 
> 
> 
> have you got the correct cascade setting on the parent object
> 
> i use the xml files for hibernate rather than the @ syntax in java classes 
> and i can set cascade="all" which means when i save/update the parent the 
> children are also saved or updated.
> 
> also remember that for hibernate to realise the children need to be updated 
> rather than saved, the child object needs to have a primary key set otherwise 
> it will want to do a save ... and if cascade was only update then nothing 
> would be done with child objects.
> 
> turn on debugging of sql in hibernate config file to see if any sql to 
> update/save children is actually being created.
> 
> 
> 
> 
> > From: brgrandj...@live.fr
> > To: user@struts.apache.org
> > Subject: Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> > Date: Wed, 31 Mar 2010 22:15:34 +0200
> >
> > Dear Rene,
> >
> > Thks a lot for replying to me because I am feeling a little bit alone with
> > my CRUD ;-). In fact I am trying to build a dynamic MetaCrud.
> > My pb is simple: in the same jsp page I would like to update a Parent object
> > and its Childs (values):
> >
> > 
> > 
> >> name="name" label="Nom" />
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > From an existing Parent object with many Childs objects I can easily modify
> > parent.name for instance but the collection of Child objects (values) is
> > always empty in the ParentAction (saveOrUpdate() method) after submitting.
> > However I can display each values[i].name in the jsp page with the correct
> > value.
> > So it is not an issue with Hibernate but with the jsp or ModelDriven
> > interface I don't know..Do you have any idea?
> > Basically I was not able to find a struts or spring documentation about CRUD
> > & association between two entities on the same jsp page.
> > best regards
> > bruno
> >
> >
> >
> > --
> > From: "Rene Gielen" 
> > Sent: Wednesday, March 31, 2010 7:12 PM
> > To: "Struts Users Mailing List" 
> > Subject: Re: CRUD with a OneToMany association under Struts 2 / Hibernate 3
> >
> >> I'm not sure if I understand what your actual question is, nor whether
> >> it is particularly Struts 2 related (rather than just Hibernate) - but
> >> you might want to have a look in the CRUD demo section of the Struts 2
> >> showcase application. Maybe you will also find this demo useful:
> >> http://github.com/rgielen/struts2crudevolutiondemo
> >>
> >> - René
> >>
> >> bruno grandjean schrieb:
> >>> Hi
> >>>
> >>> I am trying to implement a simple CRUD with a OneToMany association under
> >>> Struts 2 / Hibernate 3.
> >>> I have two entities Parent and Child:
> >>>
> >>> @Entity
> >>> @Table(name="PARENT")
> >>> public class Parent {
> >>> private Long id;
> >>> private Set values = new HashSet();
> >>> ..
> >>> @Entity
> >>> @Table(name="CHILD")
> >>> public class Child {
> >>> private Long id;
> >>> private String name;
> >>> ..
> >>>
> >>> I can easily create, delete Parent or read the Child Set (values) but it
> >>> is impossible to update Child Set.
> >>> The jsp page (see below) reinit the values Set, no record after updating!
> >>> Could u explain to me what's wrong?
> >>>
> >>> here are my code:
> >>>
> >>> @Entity
> >>> @Table(name="PARENT")
> >>> public class Parent {
> >>> private Long