Author Login
Post Reply
user Digest 25 Feb 2010 19:20:44 -0000 Issue 9012
Topics (messages 205126 through 205150):
Re: checkbox array
205126 by: Robert Graf-Waczenski
205127 by: Robert Graf-Waczenski
205128 by: lucas owen
Re: Custom Window State Struts2 Portlet
205129 by: Ricardo Jorge
205130 by: Nils-Helge Garli Hegvik
dojo dynamic attributes with struts2
205131 by: Stephen Ince
Problem reloading Struts 2 app in Tomcat and Eclipse
205132 by: Greg Lindholm
Description of current struts-2.1.8.1\lib content
205133 by: Alex Rodriguez Lopez
205134 by: Lukasz Lenart
205135 by: Alex Rodriguez Lopez
205136 by: Lukasz Lenart
Cannt connect Struts + Tiles with mysql
205137 by: abhishek jain
205138 by: Antonio Petrelli
205141 by: abhishek jain
205142 by: Antonio Petrelli
Single Sign On And Spring Security
205139 by: Lance Hill
205140 by: Frans Thamura
s:if inside s:url
205143 by: CRANFORD, CHRIS
205144 by: Dale Newfield
205145 by: CRANFORD, CHRIS
205146 by: CRANFORD, CHRIS
205147 by: Dale Newfield
Nabble and mailing list archives
205148 by: Greg Lindholm
struts 2 token interceptor problem
205149 by: repuken2
Re: Validation of indexed properties
205150 by: Cielpa
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_205126.ezm (zipped)Tatiyana Tarabara schrieb:
> Voviya,
> Could you please pick up Nadika from horse riding at 7:30 p.m. today?
> A ya popletus' v Majer.
> T.
No i won't, sorry. :-)

Attachment:
user_205127.ezm (zipped)Post the relevant part of your JSP, please. I know that at least for
Struts 2.1.8.1 there is a new MultiselectInterceptor class that would
solve your problem for a select with type=multiple. There is a
CheckboxInterceptor class as well. Maybe there is none for a checkbox
array. Anyway, let us have a look at your JSP to see what S2 tags you
are using. If all else fails, you could write your own interceptor to
deal with the issue.
Robert
lucas owen schrieb:
> mmm I'm using Struts 2 (struts2-core-2.1.6) and the last checkbox (of a
> checkbox array) doesn't get unchecked, as I have previously commented...
>
> WHY?
>
> It seems it has to be always selected one of the checkboxes at least
>
> 2010/2/23 Robert Graf-Waczenski <rgw@(protected)>
>
>
>> lucas owen schrieb:
>>
>> Hi struts users,
>>
>>> I'm working with a checkbox array; the problem is that it doesn't work as
>>> a
>>> single checkbox: I can't have the checkbox array with all checkboxes
>>> unchecked (apart from the beginning)
>>>
>>> Example:
>>>
>>> I check checkbox1.
>>> I check checkbox2.
>>> I uncheck checkbox2 --> OK
>>> I uncheck checkbox1 --> checkbox1 doesnt get unchecked
>>>
>>> Is this working as normal or I'm performing wrong???
>>>
>>> Thanks in advance
>>> Peter
>>>
>>>
>>>
>>>
>> This should work correctly out of the box with Struts2 because there are
>> interceptors and hidden parameters that work the magic for you. In Struts1,
>> there is no such magic and the behavior you describe is normal because if
>> none of the checkboxes is checked, then the resulting browser request does
>> not contain the corresponding request parameters *at all*, meaning that your
>> server-side state is unchanged. Solution: Implement the ActionForm.reset()
>> method to deal with this properly, i.e. reset your form values to null (or
>> whatever) when the request parameters are missing.
>>
>> Robert
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>
>

Attachment:
user_205128.ezm (zipped)I really think this is a bug in Struts 2 checkbox array behaviour!
to solve this problem I have created a variable to keep the value of the
previous selection.
if the actual selection is equals to the previous selection that means the
user want to uncheck the checkbox
this at least works, and is more straightforward than writing an interceptor
bye and thanks robert for your try!!!
2010/2/24 Robert Graf-Waczenski <rgw@(protected)>
> Post the relevant part of your JSP, please. I know that at least for Struts
> 2.1.8.1 there is a new MultiselectInterceptor class that would solve your
> problem for a select with type=multiple. There is a CheckboxInterceptor
> class as well. Maybe there is none for a checkbox array. Anyway, let us have
> a look at your JSP to see what S2 tags you are using. If all else fails, you
> could write your own interceptor to deal with the issue.
>
> Robert
>
> lucas owen schrieb:
>
> mmm I'm using Struts 2 (struts2-core-2.1.6) and the last checkbox (of a
>> checkbox array) doesn't get unchecked, as I have previously commented...
>>
>> WHY?
>>
>> It seems it has to be always selected one of the checkboxes at least
>>
>> 2010/2/23 Robert Graf-Waczenski <rgw@(protected)>
>>
>>
>>
>>> lucas owen schrieb:
>>>
>>> Hi struts users,
>>>
>>>
>>>> I'm working with a checkbox array; the problem is that it doesn't work
>>>> as
>>>> a
>>>> single checkbox: I can't have the checkbox array with all checkboxes
>>>> unchecked (apart from the beginning)
>>>>
>>>> Example:
>>>>
>>>> I check checkbox1.
>>>> I check checkbox2.
>>>> I uncheck checkbox2 --> OK
>>>> I uncheck checkbox1 --> checkbox1 doesnt get unchecked
>>>>
>>>> Is this working as normal or I'm performing wrong???
>>>>
>>>> Thanks in advance
>>>> Peter
>>>>
>>>>
>>>>
>>>>
>>>>
>>> This should work correctly out of the box with Struts2 because there are
>>> interceptors and hidden parameters that work the magic for you. In
>>> Struts1,
>>> there is no such magic and the behavior you describe is normal because if
>>> none of the checkboxes is checked, then the resulting browser request
>>> does
>>> not contain the corresponding request parameters *at all*, meaning that
>>> your
>>> server-side state is unchanged. Solution: Implement the
>>> ActionForm.reset()
>>> method to deal with this properly, i.e. reset your form values to null
>>> (or
>>> whatever) when the request parameters are missing.
>>>
>>> Robert
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_205129.ezm (zipped)I managed to fix it.
Although the hackish alternative I presented at the end of the message
worked, when I was implementing friendly URLs it didn't work as expected for
the id parameter because it wasn't a part of <portlet:actionURL>.
I found a way to get the ID from the value stack this way
ActionContext.getContext().getValueStack().findValue("resourceId").toString();
so my final code is now
<% String resourceId =
ActionContext.getContext().getValueStack().findValue("resourceId").toString();
%>
<portlet:actionURL windowState="exclusive">
<portlet:param name="struts.portlet.action"
value="/gdocs/gdocs/moreinformation" />
<portlet:param name="docid" value="<%= resourceId %>">
</portlet:param></portlet:actionURL>
and it's working perfectly well.
Best Regards,
Ricardo
On Mon, Feb 22, 2010 at 1:47 PM, Ricardo Jorge <rvjsapi@(protected):
> Hello.
>
> I'm using Liferay portal to develop a portlet using struts 2. I need to use
> a custom Liferay Window State called exclusive to generate a URL. This
> allows me to make AJAX calls and return only the result generated by the
> action. I have added the <custom-window-state> tag to my portlet.xml
>
> I tried
>
> <s:url windowState="exclusive" action="moreinformation">
> <s:param name="id" value="resourceId" />
> </s:url>
>
> but the windowState in the URL always ends up being 'normal' (I presume
> this is the default). I did a quick look through the Struts2 code but I
> couldn't find the place where this default value was processed (I will look
> in more detail later).
>
> I also tried
>
> <portlet:actionURL windowState="exclusive">
> <portlet:param name="struts.portlet.action"
> value="/gdocs/moreinformation" />
> <portlet:param name="id" value="---------------------" />
> </portlet:actionURL>
>
> and it works but I need to add a dynamic parameter (id) from the Value
> Stack (I'm using s:iterator) but I have no idea how to put it there.
> <s:property> doesn't work, using %{} or ${} doesn't work either.
>
> Finally, I solved this problem the following way
>
> <portlet:actionURL windowState="exclusive">
> <portlet:param name="struts.portlet.action"
> value="/gdocs/moreinformation" />
> </portlet:actionURL>&<portlet:namespace />id=<s:property
> value="resourceId" />
>
> but it feels kind of hackish and I think that there has to be a better way.
>
> Any suggestions?
>
> Best Regards,
> Ricardo
>

Attachment:
user_205130.ezm (zipped)From the source [1] (getWindowState method), it appears that only the
standard window states are considered when creating the url.
Please register a JIRA issue (tests and patch welcome indeed).
Regards,
Nils-Helge Garli Hegvik
[1] - http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/util/PortletUrlHelper.java?view=markup
On Mon, Feb 22, 2010 at 2:47 PM, Ricardo Jorge <rvjsapi@(protected):
> Hello.
>
> I'm using Liferay portal to develop a portlet using struts 2. I need to use
> a custom Liferay Window State called exclusive to generate a URL. This
> allows me to make AJAX calls and return only the result generated by the
> action. I have added the <custom-window-state> tag to my portlet.xml
>
> I tried
>
> <s:url windowState="exclusive" action="moreinformation">
> <s:param name="id" value="resourceId" />
> </s:url>
>
> but the windowState in the URL always ends up being 'normal' (I presume this
> is the default). I did a quick look through the Struts2 code but I couldn't
> find the place where this default value was processed (I will look in more
> detail later).
>
> I also tried
>
> <portlet:actionURL windowState="exclusive">
> <portlet:param name="struts.portlet.action"
> value="/gdocs/moreinformation" />
> <portlet:param name="id" value="---------------------" />
> </portlet:actionURL>
>
> and it works but I need to add a dynamic parameter (id) from the Value Stack
> (I'm using s:iterator) but I have no idea how to put it there. <s:property>
> doesn't work, using %{} or ${} doesn't work either.
>
> Finally, I solved this problem the following way
>
> <portlet:actionURL windowState="exclusive">
> <portlet:param name="struts.portlet.action"
> value="/gdocs/moreinformation" />
> </portlet:actionURL>&<portlet:namespace />id=<s:property
> value="resourceId" />
>
> but it feels kind of hackish and I think that there has to be a better way.
>
> Any suggestions?
>
> Best Regards,
> Ricardo
>

Attachment:
user_205131.ezm (zipped)Hi,
I am trying t set a dynamic attribute "required" in my s:textfield
input field. It seems struts is stripping it away. Is there a way to
set a required attribute.
e.g.
<s:textfield required="true" />
generates
<input type="text" required="true" />
Any help would be appreciated.
Steve

Attachment:
user_205132.ezm (zipped)
Attachment:
user_205133.ezm (zipped)Hi!
I've recently started a job as a webapp developer.
I've been some days already working out how Struts 2 works, I'm the kind
of person who likes to know exactly what's going on at all moments, so I
rather assemble my own app taking what I need at every moment that work
from an example.
Is there a listing somewhere where I get a description of what exaclty
acomplishes every jar in lib folder? How they relate, which ones are not
to be used together, which ones are necessary... While i'm sure this
info is somewhere, it would be nice to have it in the same place.
This way I can add them and know why I do so, not just copy the ones
from an existing example. Also, the provided apps seem to variate a lot
in how are they done, mail reader being practically the same as the
Struts1 example.
Documentation seem to be a little scattered, I would like to see a
simple list of what every bundled jar does, not have to navigate through
all plugins, guess which ones are equivalent/deprecated/already
included, etc
Thanks!!

Attachment:
user_205134.ezm (zipped)2010/2/24 Alex Rodriguez Lopez <alopez@(protected)>:
> Hi!
>
> I've recently started a job as a webapp developer.
>
> I've been some days already working out how Struts 2 works, I'm the kind of
> person who likes to know exactly what's going on at all moments, so I rather
> assemble my own app taking what I need at every moment that work from an
> example.
>
> Is there a listing somewhere where I get a description of what exaclty
> acomplishes every jar in lib folder? How they relate, which ones are not to
> be used together, which ones are necessary... While i'm sure this info is
> somewhere, it would be nice to have it in the same place.
>
> This way I can add them and know why I do so, not just copy the ones from an
> existing example. Also, the provided apps seem to variate a lot in how are
> they done, mail reader being practically the same as the Struts1 example.
>
> Documentation seem to be a little scattered, I would like to see a simple
> list of what every bundled jar does, not have to navigate through all
> plugins, guess which ones are equivalent/deprecated/already included, etc
Use Maven 2 ;-)
Regards
--
Łukasz
http://www.lenart.org.pl/
Kapituła Javarsovia 2010
http://javarsovia.pl

Attachment:
user_205135.ezm (zipped)Em 24-02-2010 16:32, Lukasz Lenart escreveu:
> 2010/2/24 Alex Rodriguez Lopez<alopez@(protected)>:
>> Hi!
>>
>> I've recently started a job as a webapp developer.
>>
>> I've been some days already working out how Struts 2 works, I'm the kind of
>> person who likes to know exactly what's going on at all moments, so I rather
>> assemble my own app taking what I need at every moment that work from an
>> example.
>>
>> Is there a listing somewhere where I get a description of what exaclty
>> acomplishes every jar in lib folder? How they relate, which ones are not to
>> be used together, which ones are necessary... While i'm sure this info is
>> somewhere, it would be nice to have it in the same place.
>>
>> This way I can add them and know why I do so, not just copy the ones from an
>> existing example. Also, the provided apps seem to variate a lot in how are
>> they done, mail reader being practically the same as the Struts1 example.
>>
>> Documentation seem to be a little scattered, I would like to see a simple
>> list of what every bundled jar does, not have to navigate through all
>> plugins, guess which ones are equivalent/deprecated/already included, etc
>
> Use Maven 2 ;-)
>
>
> Regards
Thanks, I'll check into it, it seems to be everywhere latelly although I
still don't know exactly what it is... :S
Regards

Attachment:
user_205136.ezm (zipped)2010/2/24 Alex Rodriguez Lopez <alopez@(protected)>:
>> Use Maven 2 ;-)
>
> Thanks, I'll check into it, it seems to be everywhere latelly although I
> still don't know exactly what it is... :S
You can just set up a test project and add plugins you want, when you
execute mvn package you will get war with all needed libs for that
project. It's a good way to check what is needed even if you don't use
Maven 2 ;-)
Regards
--
Łukasz
http://www.lenart.org.pl/
Kapituła Javarsovia 2010
http://javarsovia.pl

Attachment:
user_205137.ezm (zipped)Hi friends,
Just learned struts 1.2 and tiles, want to connect to mysql.
pl. find below the configuration i am using:
struts-config.xml
<data-sources>
<data-source type=*"
org.apache.commons.dbcp.BasicDataSource"*>
<set-property property=*"driverClassName"* value=*"
com.mysql.jdbc.Driver"*
/>
<set-property property=*"url"* value=*"jdbc:mysql://localhost:3306/mysqldb"*
/>
<set-property property=*"username"* value=*"root"* />
<set-property property=*"maxActive"* value=*"10"* />
<set-property property=*"maxWait"* value=*"5000"* />
<set-property property=*"defaultAutoCommit"* value=*"false"* />
<set-property property=*"defaultReadOnly"* value=*"false"* />
</data-source>
</data-sources>
<controller processorClass=*"
org.apache.struts.tiles.TilesRequestProcessor"
*/>
<plug-in className=*"
org.apache.struts.tiles.TilesPlugin"*>
<set-property property=*"definitions-config"* value=*
"/WEB-INF/tiles-defs.xml"* />
<set-property property=*"moduleAware"* value=*"true"* />
</plug-in>
I get the error message: Can't get definitions factory from context.
I know due to the datasource it cannot find the tiles defs file, but why?
Can anyone help and give me some pointers,
thanks
--
Thanks and kind Regards,
Abhishek jain

Attachment:
user_205138.ezm (zipped)2010/2/25 abhishek jain <abhishek.netjain@(protected)>:
> I get the error message: Can't get definitions factory from context.
> I know due to the datasource it cannot find the tiles defs file, but why?
Because the application failed starting, probably. Check the log
related to the start of your application.
Antonio

Attachment:
user_205141.ezm (zipped)On Thu, Feb 25, 2010 at 6:40 PM, Antonio Petrelli <
antonio.petrelli@(protected):
> 2010/2/25 abhishek jain <abhishek.netjain@(protected)>:
> > I get the error message: Can't get definitions factory from context.
> > I know due to the datasource it cannot find the tiles defs file, but why?
>
> Because the application failed starting, probably. Check the log
> related to the start of your application.
>
> Antonio--
>
Hi ,
Thanks for the help, it narrowed the problem to the following error,
Where should i look next,
Feb 25, 2010 8:46:32 PM
org.apache.struts.action.ActionServlet init
SEVERE: Unable to initialize Struts ActionServlet due to an unexpected
exception or error thrown, so marking the servlet as unavailable. Most
likely, this is due to an incorrect or missing library dependency.
java.lang.NoClassDefFoundError: org/apache/commons/pool/ObjectPool
Thanks for the help, really appreciated,
--
Thanks and kind Regards,
Abhishek jain

Attachment:
user_205142.ezm (zipped)2010/2/25 abhishek jain <abhishek.netjain@(protected)>:
> Feb 25, 2010 8:46:32 PM
org.apache.struts.action.ActionServlet init
> SEVERE: Unable to initialize Struts ActionServlet due to an unexpected
> exception or error thrown, so marking the servlet as unavailable. Most
> likely, this is due to an incorrect or missing library dependency.
>
java.lang.NoClassDefFoundError: org/apache/commons/pool/ObjectPool
The error says it all, you need commons-pool:
http://commons.apache.org/pool/
Antonio

Attachment:
user_205139.ezm (zipped)Hello,
I am hoping someone can provide me with some links or examples of how to
combine Struts 2 with Spring security. The end goal is to use Spring
security to access a CAS server (http://www.jasig.org/cas) in order to
provide single sign on ability between a Struts2 application and a Wordpress
site.
Thank you,
Lance Hill

Attachment:
user_205140.ezm (zipped)i believe the cool reference only roller 5 which it is not released yet
F
On Thu, Feb 25, 2010 at 10:11 PM, Lance Hill <lance@(protected):
> Hello,
>
>
>
> I am hoping someone can provide me with some links or examples of how to
> combine Struts 2 with Spring security. The end goal is to use Spring
> security to access a CAS server (http://www.jasig.org/cas) in order to
> provide single sign on ability between a Struts2 application and a
> Wordpress
> site.
>
>
>
> Thank you,
>
> Lance Hill
>
>
>
>

Attachment:
user_205143.ezm (zipped)Is there a solution to support this type of tag logic:
<s:if test='%{#attr.row.department != null}'>Not
Null<br/></s:if><s:else>Null</s:else>
<s:url id='numItemsUrl' action='searchTransactionsSubmit'>
<s:param name='reportType'>ID</s:param>
<s:param name='transactionType'><s:property
value='#attr.row.transactionTypeId'/></s:param>
<s:if test='%{#attr.row.department != null}'>
<s:param name='department'><s:property
value='#attr.row.department'/></s:param>
</s:if>
</s:url>
What I find are the records where the department field outputs "Not
Null" never has the department parameter added to the numItemsUrl inside
the S:URL tag. It seems as though the S:IF is either 1) not interpreted
or 2) fails the test.
Aside from reformatting the tag layout to:
<s:if test='%{#attr.row.department != null}'>
<s:url ....>
<s:param>...</s:param>
</s:url>
</s:if>
I'm not sure what else I can do. The problem is there are 5 variables
that get added to the URL and I need to control which ones are added and
which are not added based on specific conditions and having this broken
out into 5 or 6 different if blocks to create the same URL seems
redundant when the IF tag should suffice.
Thoughts?

Attachment:
user_205144.ezm (zipped)CRANFORD, CHRIS wrote:
> <s:if test='%{#attr.row.department != null}'>
> <s:param name='department'><s:property
> value='#attr.row.department'/></s:param>
> </s:if>
<s:param name="department" value="%{(#attr.row.department ==
null)?'':#attr.row.department}"/>
-Dale

Attachment:
user_205145.ezm (zipped)Dale -
That still renders "&department=" on the request when the department
field is null which is not what I want. I want to not include the
parameter at all on the request if it's null.
Null = Records with department field null
Empty/Not Null = All records, not limited by department
Not Empty/Not Null = Records with the department field value
Those are the three conditions I am trying to satisfy.
> -----Original Message-----
> From: Dale Newfield [mailto:dale@(protected)]
> Sent: Thursday, February 25, 2010 11:35 AM
> To: Struts Users Mailing List
> Subject: Re: s:if inside s:url
>
> CRANFORD, CHRIS wrote:
> > <s:if test='%{#attr.row.department != null}'>
> > <s:param name='department'><s:property
> > value='#attr.row.department'/></s:param>
> > </s:if>
>
> <s:param name="department" value="%{(#attr.row.department ==
> null)?'':#attr.row.department}"/>
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment:
user_205146.ezm (zipped)Although, I didn't consider this solution, which seems sort of broken
but appears to at least work and provide the desired effect:
<s:param name="%{#attr.row.department==null?'d':'department'}">
<s:property value="%{#attr.row.department}"/>
</s:param>
If the department value is null, the request parameter is named "d"
rather than "department". It is only "department" when the parameter is
not null.
I still do not understand why you cannot wrap a s:param tag with a s:if
construct to control whether a parameter is appended to the s:url or
not.
According to Eclipse, placing a s:if inside the s:url around an s:param
is not considered abnormal use of the tags, so I'm at a loss.
> -----Original Message-----
> From: Dale Newfield [mailto:dale@(protected)]
> Sent: Thursday, February 25, 2010 11:35 AM
> To: Struts Users Mailing List
> Subject: Re: s:if inside s:url
>
> CRANFORD, CHRIS wrote:
> > <s:if test='%{#attr.row.department != null}'>
> > <s:param name='department'><s:property
> > value='#attr.row.department'/></s:param>
> > </s:if>
>
> <s:param name="department" value="%{(#attr.row.department ==
> null)?'':#attr.row.department}"/>
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment:
user_205147.ezm (zipped)CRANFORD, CHRIS wrote:
> That still renders "&department=" on the request when the department
> field is null which is not what I want.
I understand the desire to have "pretty" urls, but technically the
presence or absence of "&department=" in the url is not distinguishable
by the action created when this url is requested.
If you're trying to distinguish between null and empty, you need a way
to signal that distinction to the action. One or two reserved
department ids/names that you interpret as these "magic" values would
solve your problem:
for example:
<s:param name="department" value="%{(#attr.row.department ==
null)?'null':(#attr.row.department.isEmpty?'unconstrained':#attr.row.department)}"/>
-Dale

Attachment:
user_205148.ezm (zipped)This mailing list on Nabble seems to be gone, at least I can't find it.
Nabble switched over to a new system and old system is now at
old.nabble.com but doesn't seem to be getting updates anymore.
Anyone working to get this mailing list archived on the "New and
Improved" nabble or is there a better place to search the mail
archives?

Attachment:
user_205149.ezm (zipped)
Hi,
i'm having trouble with token interceptor, i'm using struts 2.1.8.1 with
eclipse and glassfish V3.
***we're using struts 1 plugin*** , we're migrating an old project wich
used struts 1 and so far everything is working ok, fileupload interceptor,
forms, etc. but toke-interceptor stuff. When goin from an action to another
that is protected-affected by this token-interceptor ( the jsp has the
<s:token\> tag and the config.xml is properly configured having the
interceptor-ref token in the corresponding action) the interceptor indeed
works and interceps but it always return invalid.token result. The action
never executes as the application flow is interrupted at the interceptor
stage.
Has anybody experimented something similar? using struts 1 plugin or not?
does it have to do with this plugin and it would work using pure struts 2? (
don't ask me why but we need this up and working with the S1 plugin) , any
ideas??
Cheerz and thanks in advance,
best regards.
Manuel
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_205150.ezm (zipped)Hey,
I have a similar problem with DynaValidatorActionForm.
It says that invalid property when i have a ArrayList in the <form-property
name="searchList" type="
java.util.ArrayList"/> in the <form-bean
declaration.
Any idea?
Thanks and your help is appreciated.
Silpa
hugh111111 wrote:
>
> I've got a problem relating to the validation of indexed properties in
> Struts 1.1
> I get the following error message when I try to access an ArrayList of
> students in my DynaValidatorForm
>
> root cause
>
>
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
>
java.util.ArrayList.RangeCheck(Unknown Source)
>
java.util.ArrayList.get(Unknown Source)
>
org.apache.struts.action.DynaActionForm.get (
DynaActionForm.java:298)
>
>
>
> Here is some background to the problem...
>
> In my session I have an ArrayList called studentsList of objects of type
> experiment.mybeans.Student. A Student object has getter and setter methods
> for id, year and gradeAverage.
>
> In my students.jsp I create a table by iterating through my student
> objects like this...
>
> <c:forEach var="students" items="${sessionScope.group.studentsList}" >
> <tr><td><html:text indexed="true" name="students" property="id"/></td>
> <td><html:text indexed="true" name="students" property="year"/></td>
> <td><html:text indexed="true" name="students"
> property="gradeAverage"/></td></tr>
> </c:forEach>
>
> As you can see the table contains empty text boxes and I would like to
> validate these have been filled in, so in struts-config.xml I create my
> dynavalidatorform as follows...
>
> <form-bean name="studentsForm"
> type="
org.apache.struts.validator.DynaValidatorForm" >
> <form-property name="students" type="
java.util.ArrayList" />
> </form-bean>
>
> And in validation.xml I place my validation rules...
>
> <form name="studentsForm">
> <field property="id" indexedListProperty="students" depends="required">
> <arg0 key="error.studentid.required"/>
> </field>
> <field property="year" indexedListProperty="students"
> depends="required">
> <arg0 key="error.studentyear.required"/>
> </field>
> <field property="gradeAverage" indexedListProperty="students"
> depends="required">
> <arg0 key="error.studentgrade.required"/>
> </field>
> </form>
>
> Now here is where things start to go a bit pear-shaped
>
> I have read somewhere online that I need to populate the form ArrayList
> before I get to my jsp page. So I have created an action class called
> PreStudentsAction.java which takes the student ArrayList out of the
> session and assigns it to the student ArrayList in the form before
> forwarding to the students.jsp page...
>
> public class PreStudentsAction extends Action{
>
> public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response)
> throws Exception
> {
>
> DynaValidatorForm myForm = (DynaValidatorForm)form;
> Group group = (Group)request.getSession().getAttribute("group");
> ArrayList<Student> students = group.getStudentsList();
>
> myForm.set("students", students);
> return (mapping.findForward("success"));
> }
>
> }
>
>
> Finally when I run my application my table is displayed but when I fill in
> the table and press submit I get the IndexOutOfBounds error. It appears to
> me that the student ArrayList in the form remains empty and that my Action
> class was unsuccessful in populating the form's ArrayList.
>
> Can anybody see what I'm doing wrong?
>
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.