Hi. I'm having problem in submitting a dynamic form created with a list of
beans.
I'm able to build the jsp with the form and (it seems...) to pass parameters
to action, 
but I'm not able to get the correct list of beans after submitting the form.
I've tried with a list of 2 beans. Something really strange happens: 
the list in the action is not null (ok, this shouldn't be strange, if I've
done all correctly) 
and has a size equals to the id of a bean (and this is really strange, maybe
there's something wrong?...).
Due to the list size, at the end of the action there is also
OutOfMemoryError (Java heap space).

So, is it an ognl expression problem? I've tried many version but without
success.
name="#Song[SongId].startDate"
name="%{#Song[SongId]}.endDate"
name="songs[SongId].statusLoad"
name="songs[#Song.SongId].statusSellable"
name="%{songs[#Song.SongId]}.endDate"
name="%{#songs[Song.SongId]}.statusLoad" 

I'm using struts 2.0.11.

Some code:

-ACTION
public class ResubmitAction extends BaseAction {
    private List<Song> songs = new ArrayList();
        public String resubmitCatalog() {
        ...
                if(songs != null) {
                        log.debug("song size "+songs.size());
                }
        }
        public List<Song> getSongs() {return songs;}
    public void setSongs(List<Song> songs) {this.songs = songs;}
}       

-BEAN
public class Song implements Serializable {
    private String SongId;
        ...
    private String StartDate;
    private String EndDate;
    private String StatusLoad;
    private String StatusSellable;
    ...
    public String getStartDate() {return StartDate;}
    public void setStartDate(String startDate) {StartDate = startDate;}
    public String getEndDate() {return EndDate;}
    public void setEndDate(String endDate) {EndDate = endDate;}
    public String getStatusLoad() {return StatusLoad;}
    public void setStatusLoad(String statusLoad) {StatusLoad = statusLoad;}
    public String getStatusSellable() {return StatusSellable;}
    public void setStatusSellable(String statusSellable) {StatusSellable =
statusSellable;}
    public String getSongId() {return SongId;}
    public void setSongId(String songId) {SongId = songId;}
}

-CONVERSION PROP
ResubmitAction-Conversion.properties (in the same path of
ResubmitAction.java)

KeyProperty_songs=SongId
Element_songs=console.beans.Song
CreateIfNull_songs=true

-JSP 
<s:iterator id="Song" value="songs">
<tr>
        <td><s:hidden name="songs[%{#Song.SongId}].SongId"
value="%{#Song.SongId}"/></td>
</tr>
<tr>
        <td class="txtBold">START DATE</td>
        <td><s:textfield theme="simple" name="songs[%{#Song.SongId}].startDate"
/></td>
</tr>
<tr>
        <td class="txtBold">END DATE</td>      
        <td><s:textfield theme="simple"
name="songs[%{#Song.SongId}].endDate"/></td>
</tr>
<tr>
        <td class="txtBold">STATUS LOAD</td>
        <td><s:textfield theme="simple" name="songs[%{#Song.SongId}].statusLoad"
/></td>
</tr>
<tr>
        <td class="txtBold">STATUS SELLABLE</td>
        <td><s:textfield theme="simple"
name="songs[%{#Song.SongId}].statusSellable" /></td>
</tr>
...
</s:iterator>

and the HTML is:

<input type="hidden" id="ResubmitCatalog_songs_9121587__SongId"
value="9121587" name="songs[9121587].SongId"/>
<input type="text" id="ResubmitCatalog_songs_9121587__startDate" value=""
name="songs[9121587].startDate"/>
<input type="text" id="ResubmitCatalog_songs_9121587__endDate" value=""
name="songs[9121587].endDate"/>
<input type="text" id="ResubmitCatalog_songs_9121587__statusLoad" value=""
name="songs[9121587].statusLoad"/>
<input type="text" id="ResubmitCatalog_songs_9121587__statusSellable"
value="" name="songs[9121587].statusSellable"/>

and another group of input with the second id 9121591


-LOG
DEBUG (interceptor.ParametersInterceptor:148) - Setting params (...)
songs[9121591].startDate => [ XXX ] songs[9121587].endDate => [ XXX ] 
songs[9121591].statusLoad => [ XXX ] songs[9121587].statusSellable => [ XXX
] songs[9121587].SongId => [ 9121587 ] songs[9121591].endDate => [ XXX ]
songs[9121587].startDate => [ XXX ] songs[9121591].SongId => [ 9121591 ]
songs[9121591].statusSellable => [ XXX ] songs[9121587].statusLoad => [ XXX
] 
ERROR (interceptor.ParametersInterceptor:204) - ParametersInterceptor -
[setParameters]: Unexpected Exception caught setting 'songs[9121587].SongId'
on 'class it.telecomitalia.orchestrator.console.actions.ResubmitAction:
Error setting expression 'songs[9121587].SongId' with value
'[Ljava.lang.String;@3ed81c'
ERROR (interceptor.ParametersInterceptor:204) - ParametersInterceptor -
[setParameters]: Unexpected Exception caught setting
'songs[9121587].endDate' on 'class
it.telecomitalia.orchestrator.console.actions.ResubmitAction: Error setting
expression 'songs[9121587].endDate' with value '[Ljava.lang.String;@1de52ea'
ERROR (interceptor.ParametersInterceptor:204) - ParametersInterceptor -
[setParameters]: Unexpected Exception caught setting
'songs[9121587].startDate' on 'class
it.telecomitalia.orchestrator.console.actions.ResubmitAction: Error setting
expression 'songs[9121587].startDate' with value
'[Ljava.lang.String;@1158ce4'
(...)
song size = 9121591
(...)
ERROR java.lang.OutOfMemoryError: Java heap space


Thanks in advance.
-- 
View this message in context: 
http://www.nabble.com/-S2--Beans-list-in-Dynamic-form-and-ParametersInterceptor-problem-tp15016850p15016850.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to