Author Login
Post Reply
user Digest 13 Jul 2009 13:18:15 -0000 Issue 8746
Topics (messages 200621 through 200650):
Re: reachable valuestack properties exposed by previous actions?
200621 by: Dimitrios Christodoulakis
200623 by: Dave Newton
200625 by: Dimitrios Christodoulakis
200627 by: Dave Newton
200629 by: Dimitrios Christodoulakis
Re: <s:actionerrors> not displaying errors!
200622 by: taj uddin
200624 by: Dave Newton
200626 by: Martin Gainty
200628 by: Dave Newton
Struts2, JQuery and JSON result to create a dynamic ajax website
200630 by: GF
200635 by: Frans Thamura
200638 by: Wes Wannemacher
200641 by: GF
200642 by: Vishnu Vyasan Nelliparmbil
200643 by: GF
200644 by: Nils-Helge Garli Hegvik
200645 by: GF
problem with deleting objects from a collection
200631 by: Dimitrios Christodoulakis
200632 by: Dave Newton
200633 by: Dimitrios Christodoulakis
200640 by: Dimitrios Christodoulakis
200649 by: Dimitrios Christodoulakis
s:checkbox inside a s:iterator and values in a Integer[]
200634 by: Ignacio de Córdoba
200636 by: Musachy Barroso
200637 by: Ignacio de Córdoba
Re: Struts 2.1.6's bug? or my configuration error?
200639 by: Yuan12345
Migration from Struts1 to Struts2
200646 by: Lasantha Pambagoda
validwhen question
200647 by: Odelya YomTov
Uploading large files
200648 by: Daniele Development-ML
Re: updating or deleting a component from a collection through display tag
200650 by: Greg Lindholm
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_200621.ezm (zipped)Thanks, I will look into action chaining and see if it can help me in
this situation.
On Sun, Jul 12, 2009 at 8:22 AM, Dave Newton<newton.dave@(protected):
> Dimitrios Christodoulakis wrote:
>>
>> This is a quick question that I am having, more on the theory side.
>> So, what happens to properties exposed on the valuestack by some
>> action which was called in the past, meaning the application workflow
>> has progressed and other actions were called after that. Is that
>> property somehow still reachable on the stack (by other actions and
>> action results), or is it popped from the stack as soon as another
>> action is called?
>
> If you're not using action chaining the stack is popped between requests.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200623.ezm (zipped)Dimitrios Christodoulakis wrote:
> Thanks, I will look into action chaining and see if it can help me in
> this situation.
Oh, please don't; it just leads to maintenance nightmares.
Dave

Attachment:
user_200625.ezm (zipped)Thanks for the warning. Actually, I thought it might help me solve
another issue I am facing: deleting objects from a collection. I tried
to explain in my previous thread but, I think I might have not
described the problem correctly.
On Sun, Jul 12, 2009 at 10:14 AM, Dave Newton<newton.dave@(protected):
> Dimitrios Christodoulakis wrote:
>>
>> Thanks, I will look into action chaining and see if it can help me in
>> this situation.
>
> Oh, please don't; it just leads to maintenance nightmares.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200627.ezm (zipped)Dimitrios Christodoulakis wrote:
> Thanks for the warning. Actually, I thought it might help me solve
> another issue I am facing: deleting objects from a collection. I tried
> to explain in my previous thread but, I think I might have not
> described the problem correctly.
To paraphrase an old saying:
I had a problem where I needed to delete objects from a collection. I
decided to use action chaining. Then I had two problems.
In other words, if action chaining is the solution, then chances are the
problem isn't being stated very well--there is almost *always* a better,
cleaner way to do it.
Dave

Attachment:
user_200629.ezm (zipped)Appreciate the warning. Thanks, I'll try to avoid that then. Alright,
I'll take the chance to re-state my problem in a new thread.
On Sun, Jul 12, 2009 at 11:15 AM, Dave Newton<newton.dave@(protected):
> Dimitrios Christodoulakis wrote:
>>
>> Thanks for the warning. Actually, I thought it might help me solve
>> another issue I am facing: deleting objects from a collection. I tried
>> to explain in my previous thread but, I think I might have not
>> described the problem correctly.
>
> To paraphrase an old saying:
>
> I had a problem where I needed to delete objects from a collection. I
> decided to use action chaining. Then I had two problems.
>
> In other words, if action chaining is the solution, then chances are the
> problem isn't being stated very well--there is almost *always* a better,
> cleaner way to do it.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200622.ezm (zipped)Hi Kavitha,
The action error message will not be carried to the JSP page if u r doing the redirect-action. The Message will be lost. If so, then u have to store the error message in the session and retrieve it in the redirected action class.
In case, if u r not doing the redirect-action, then please remove the id attribute fron the <s:actionerror> tag and try again.
My guess would be, u must be redirecting the action on success.
--- On Thu, 7/9/09, Kavita Mehta <Kavita.Mehta@(protected):
From: Kavita Mehta <Kavita.Mehta@(protected)>
Subject: <s:actionerrors> not displaying errors!
To: "Struts Users Mailing List" <user@(protected)>
Date: Thursday, July 9, 2009, 9:14 AM
Hi,
I am using Struts 2.0 and I am not able to display the action errors in
my JSP.
Action class code :
if( ( getSelectedlocation() == null ) || getSelectedlocation().compareTo(
"" ) == 0
&& ( (getLocation() == null ) ||(
getLocation().compareTo( "" ) == 0 )))
{
mLog.warn( "Location not
specified. Added Error message" );
addActionError( "Please specify a
Location for the message . " );
}
JSP code :
<tr>
<td align="left" valign="top"><p><s:actionerror id="err" /></p></td>
</tr>
The error is added successfully as i can see from the logs but it is not
getting displayed on the JSP ..any pointers ?
Thanks,
Kavita
*****************************************************DISCLAIMER*****************************************************
This message and/or attachment(s) contained here are confidential, proprietary to HUGHES SYSTIQUE and its customers.
Contents may be privileged or otherwise protected by law. The information is solely intended for the entity it is
addressed to. If you are not the intended recipient of this message, it is strictly prohibited to read, forward,
print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error,
please notify the sender immediately and delete the message.
********************************************************************************************************************

Attachment:
user_200624.ezm (zipped)taj uddin wrote:
> My guess would be, u must be redirecting the action on success.
Why do you only abbreviate the shortest words? Why not just type them
out? Are you texting your mailing list messages?
Dave

Attachment:
user_200626.ezm (zipped)
he's afraid someone from the list might yell at him for being "too verbose"
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung
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.
> Date: Sun, 12 Jul 2009 11:16:08 -0400
> From: newton.dave@(protected)
> To: user@(protected)
> Subject: Re: <s:actionerrors> not displaying errors!
>
> taj uddin wrote:
> > My guess would be, u must be redirecting the action on success.
>
> Why do you only abbreviate the shortest words? Why not just type them
> out? Are you texting your mailing list messages?
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009

Attachment:
user_200628.ezm (zipped)Martin Gainty wrote:
> he's afraid someone from the list might yell at him for being "too verbose"
I don't think anybody minds verbose when it's on-topic.
Dave

Attachment:
user_200630.ezm (zipped)Hello all,
i wrote a simple guide that explains how to use together Struts2 and
JQuery to create dynamic content with Ajax and JSON.
http://www.zulutown.com/blog/2009/07/12/ajax-dynamic-content-with-struts2-jquery-and-json-plugin/
I hope someone can appreciate it
Thank You

Attachment:
user_200635.ezm (zipped)Cool. Can I have the full code? Frans
------Original Message------
From: GF
To: Struts Users ML
ReplyTo: Struts Users Mailing List
Subject: Struts2, JQuery and JSON result to create a dynamic ajax website
Sent: Jul 13, 2009 02:49
Hello all,
i wrote a simple guide that explains how to use together Struts2 and
JQuery to create dynamic content with Ajax and JSON.
http://www.zulutown.com/blog/2009/07/12/ajax-dynamic-content-with-struts2-jquery-and-json-plugin/
I hope someone can appreciate it
Thank You
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
Frans Thamura

Attachment:
user_200638.ezm (zipped)On Sunday 12 July 2009 03:49:54 pm GF wrote:
> Hello all,
> i wrote a simple guide that explains how to use together Struts2 and
> JQuery to create dynamic content with Ajax and JSON.
>
> http://www.zulutown.com/blog/2009/07/12/ajax-dynamic-content-with-struts2-j
>query-and-json-plugin/
>
> I hope someone can appreciate it
>
A quick look at your tutorial makes me think you are underestimating the
capability of the JSON plugin. It is fully capable of serializing most java
objects to JSON. Rather than explicitly creating a hashmap, why not put the
'item' on the action and then set a json result with item configured as the
root object.
-Wes
--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

Attachment:
user_200641.ezm (zipped)Thank You for the nice comment.
I just wrote some code snippets for the tutorials.. i didn't have
enough time to build a full eclipse web project, if you have some
difficulties, ask :-)
On Mon, Jul 13, 2009 at 12:33 AM, Frans Thamura<frans@(protected):
> Cool. Can I have the full code? Frans

Attachment:
user_200642.ezm (zipped)Good Stuff,
Thanks a Lot. Expecting more in future.
-----Original Message-----
From: GF [mailto:ganfab@(protected)]
Sent: Monday, July 13, 2009 10:10 AM
To: Struts Users Mailing List; frans@(protected)
Subject: Re: Struts2, JQuery and JSON result to create a dynamic ajax
website
Thank You for the nice comment.
I just wrote some code snippets for the tutorials.. i didn't have
enough time to build a full eclipse web project, if you have some
difficulties, ask :-)
On Mon, Jul 13, 2009 at 12:33 AM, Frans Thamura<frans@(protected)>
wrote:
> Cool. Can I have the full code? Frans
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_200643.ezm (zipped)You're absolutely right,
but there is a "security reason", in real-world application, the
objects i get from business service, are usually JPA entities, and
putting a "full JPA entity" on the json result will lead to issues in
the case there are some properties of that object that have to kept
"hidden" to the end users.. (i.e. in the case of a "User" entity,
would a not good idea to return in the json result its hashed
password).
Your suggestion would surely lead to a "clean code" but an
unexperienced programmer might show to its website user some
information he didn't want to...
> A quick look at your tutorial makes me think you are underestimating the
> capability of the JSON plugin. It is fully capable of serializing most java
> objects to JSON. Rather than explicitly creating a hashmap, why not put the
> 'item' on the action and then set a json result with item configured as the
> root object.

Attachment:
user_200644.ezm (zipped)Did you look at the "Excluding properties" example in the json plugin
documentation?
Nils-H
On Mon, Jul 13, 2009 at 9:15 AM, GF<ganfab@(protected):
> You're absolutely right,
> but there is a "security reason", in real-world application, the
> objects i get from business service, are usually JPA entities, and
> putting a "full JPA entity" on the json result will lead to issues in
> the case there are some properties of that object that have to kept
> "hidden" to the end users.. (i.e. in the case of a "User" entity,
> would a not good idea to return in the json result its hashed
> password).
>
> Your suggestion would surely lead to a "clean code" but an
> unexperienced programmer might show to its website user some
> information he didn't want to...
>
>
>
>
>> A quick look at your tutorial makes me think you are underestimating the
>> capability of the JSON plugin. It is fully capable of serializing most java
>> objects to JSON. Rather than explicitly creating a hashmap, why not put the
>> 'item' on the action and then set a json result with item configured as the
>> root object.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200645.ezm (zipped)You're right too ;-)
I didn't want to substitute to the plugin documentation.
I'd prefer the "include properties" behaviour anyway.
I believe a good idea could be to use @JsonInclude annotation on the
entity properties to define (just ONE time on the entities) which of
their properties are "safe to return" in the json serialization
Thank You again.
On Mon, Jul 13, 2009 at 9:33 AM, Nils-Helge Garli
Hegvik<nilsga@(protected):
> Did you look at the "Excluding properties" example in the json plugin
> documentation?
>
> Nils-H
>
> On Mon, Jul 13, 2009 at 9:15 AM, GF<ganfab@(protected):
>> You're absolutely right,
>> but there is a "security reason", in real-world application, the
>> objects i get from business service, are usually JPA entities, and
>> putting a "full JPA entity" on the json result will lead to issues in
>> the case there are some properties of that object that have to kept
>> "hidden" to the end users.. (i.e. in the case of a "User" entity,
>> would a not good idea to return in the json result its hashed
>> password).
>>
>> Your suggestion would surely lead to a "clean code" but an
>> unexperienced programmer might show to its website user some
>> information he didn't want to...
>>
>>
>>
>>
>>> A quick look at your tutorial makes me think you are underestimating the
>>> capability of the JSON plugin. It is fully capable of serializing most java
>>> objects to JSON. Rather than explicitly creating a hashmap, why not put the
>>> 'item' on the action and then set a json result with item configured as the
>>> root object.
>>
>> ---------------------------------------------------------------------
>> 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_200631.ezm (zipped)Good afternoon,
I am re-stating a problem I am facing, for which I provided a kind of
complicated description before: Deleting objects from a collection.
The owning, parent object is a hibernate persistent entity, which
contains a collection of components (value-type objects). Such
components don't have shared references, which means that removing a
component from the collection results in deleting the object from the
database.
I am calling an action which exposes the parent entity, goalToAchieve,
and the result page iterates over the collection
goalToAchieve.entries:
<display:table name="goalToAchieve.entries" requestURI="" uid="thisGoal">
<display:column property="entry" />
<display:column property="date" sortable="true"
defaultorder="ascending" title="TimeStamp"/>
</display:table>
The above works, fine. Each row of the table is an instance of the
JournalEntry class displaying two fields: an entry of type String and
a date of type Date. My objective is to give the user the option to
update or delete each row right from the table view. So, I thought to
add two more columns in each row: Update or Delete. I have not been
able to implement this properly, I tried with a url, and with a form.
My guess is that I cannot pass a reference to the row back to the
action performing the delete or update. Am I making this more
complicated than it really is? What can I be missing?
I tried adding one more column like this, hoping the entry property
will be available to the DeleteEntry action via the mini-form.
<display:column>
<s:form action="DeleteEntry">
<s:property value="entry"/>
<s:hidden name="id" value="%{goalToAchieve.id}" />
<s:submit value="Remove"/>
</s:form>
</display:column>
The DeleteEntry action has all the getters and setters:
public String execute(){
goalToAchieve = getSubscriberService().getGoalToAchieve(id);
goalToAchieve.deleteEntry(entry);
return SUCCESS;
}
public void setEntry(JournalEntry entry){
this.entry = entry;
}
public JournalEntry getEntry(){
return entry;
}
But I get
java.lang.NullPointerException: actions.DeleteEntry.execute
1) I am not sure if the reference to the entry is passing over to the
action, and
2) if it does, seems like there is no entry object instantiated. But
the entry was instantiated at the time of the insert.
Any ideas about this, and general guidelines on deleting objects from
collections?
Appreciate the help.

Attachment:
user_200632.ezm (zipped)Dimitrios Christodoulakis wrote:
> I tried adding one more column like this, hoping the entry property
> will be available to the DeleteEntry action via the mini-form.
>
> <display:column>
> <s:form action="DeleteEntry">
> <s:property value="entry"/>
> <s:hidden name="id" value="%{goalToAchieve.id}" />
> <s:submit value="Remove"/>
> </s:form>
> </display:column>
What's that <s:property.../> supposed to be doing?
It's not a form field; there's no entry reference being passed back.
Even if it *was* a form field it's still not passing a *reference*
back--forms *only* submit strings. Always. If you want an actual *entry*
object there either needs to be some type conversion, database
retrieval, etc.
Dave

Attachment:
user_200633.ezm (zipped)Thanks Dave,
Yes, the <s:property.../> isn't supposed to be there.... Thanks for
pointing this out. Indeed, it has to be an object there, in order to
do the remove from the collection. Since this value-type component
(entry) does not have a primary key to look it up from, I am a bit at
a loss how to continue from here.
If you don't mind, could you explain a little bit further? I have
successfully removed entity object from collections before because all
I neede was the primary key to be passed to the delete action. Then
inside the action I did the look up using the key and removed the
object. But with this type of object I have hit a roadblock.
I appreciate any further help.
This is the class:
@Embeddable
public class JournalEntry {
@
org.hibernate.annotations.Parent private GoalToAchieve goalToAchieve;
@Column(length = 255, nullable = false)
private String entry;
@Temporal(TemporalType.TIMESTAMP)
@Column(nullable = false, updatable = false)
private Date insertDate = new Date();
....plus the appropriate getters and setters..
On Sun, Jul 12, 2009 at 5:03 PM, Dave Newton<newton.dave@(protected):
> Dimitrios Christodoulakis wrote:
>>
>> I tried adding one more column like this, hoping the entry property
>> will be available to the DeleteEntry action via the mini-form.
>>
>> <display:column>
>> <s:form action="DeleteEntry">
>> <s:property value="entry"/>
>> <s:hidden name="id" value="%{goalToAchieve.id}" />
>> <s:submit value="Remove"/>
>> </s:form>
>> </display:column>
>
> What's that <s:property.../> supposed to be doing?
>
> It's not a form field; there's no entry reference being passed back. Even if
> it *was* a form field it's still not passing a *reference* back--forms
> *only* submit strings. Always. If you want an actual *entry* object there
> either needs to be some type conversion, database retrieval, etc.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200640.ezm (zipped)I am starting to think that using embeddable might be more hassle than
it sounds. i am considering switching to an entity object and dealing
with a collection of entities instead. Given that I will not have any
shared references anyway, it might solve the problem.
I tried attaching a unique field to each embeddable, like a
System.currentTimeMillis(), just to identify the entries, but although
I can display the properties of each object in the collection, since
the object actually exposed is the parent owning object, I can't
attach a specific component attribute as a url parameter:
<a href="<s:url action='DeleteEntryForm' var="entry" escapeAmp="false">
<s:param name="name" value="%{goalToAchieve.owner.fullName}" />
<s:param name="id" value="%{goalToAchieve.id}" />
<s:param name="mark" value="mark" />
<s:property value="%{entry}"/>
</s:url>
">Remove</a>
Now, I added the follow to the class:
@Column
private Long mark;
public Long getMark() {
return mark;
}
public void setMark(long mark){ //set at each new instance
this.mark = mark;
}
But the parameter is not added to the url. Am I doing this wrong, or
is there another way before switching to entities?
Thanks again.
On Sun, Jul 12, 2009 at 5:03 PM, Dave Newton<newton.dave@(protected):
> Dimitrios Christodoulakis wrote:
>>
>> I tried adding one more column like this, hoping the entry property
>> will be available to the DeleteEntry action via the mini-form.
>>
>> <display:column>
>> <s:form action="DeleteEntry">
>> <s:property value="entry"/>
>> <s:hidden name="id" value="%{goalToAchieve.id}" />
>> <s:submit value="Remove"/>
>> </s:form>
>> </display:column>
>
> What's that <s:property.../> supposed to be doing?
>
> It's not a form field; there's no entry reference being passed back. Even if
> it *was* a form field it's still not passing a *reference* back--forms
> *only* submit strings. Always. If you want an actual *entry* object there
> either needs to be some type conversion, database retrieval, etc.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200649.ezm (zipped)I think I might have an idea why the iterator or display tag do not
allow for working with collection items.
In the past I used form tags (like select) to prompt the user to make
a selection from a menu, my thought is that since I was using form
tags, by submitting the form, the property (item from the collection)
is passed to the valuestack and the action can work with it.
But an iterator or a display tag do not necessarily put properties on
the valuestack. Is this correct? I was wondering if I could use a set,
or push tag to either store the property to the scope or put it on the
top of the valuestack that way? Would you say this is a valid
strategy?
This has been troubling me for a few days, so I hope it is alright to
post my new thought on this. Thank you for any new input.
On Sun, Jul 12, 2009 at 5:16 PM, Dimitrios
Christodoulakis<dimi.chr@(protected):
> Thanks Dave,
>
> Yes, the <s:property.../> isn't supposed to be there.... Thanks for
> pointing this out. Indeed, it has to be an object there, in order to
> do the remove from the collection. Since this value-type component
> (entry) does not have a primary key to look it up from, I am a bit at
> a loss how to continue from here.
>
> If you don't mind, could you explain a little bit further? I have
> successfully removed entity object from collections before because all
> I neede was the primary key to be passed to the delete action. Then
> inside the action I did the look up using the key and removed the
> object. But with this type of object I have hit a roadblock.
>
> I appreciate any further help.
>
>
> This is the class:
>
> @Embeddable
> public class JournalEntry {
>
> @(protected)
> private GoalToAchieve goalToAchieve;
>
> @(protected))
> private String entry;
>
> @(protected))
> @(protected))
> private Date insertDate = new Date();
>
>
> ....plus the appropriate getters and setters..
>
> On Sun, Jul 12, 2009 at 5:03 PM, Dave Newton<newton.dave@(protected):
>> Dimitrios Christodoulakis wrote:
>>>
>>> I tried adding one more column like this, hoping the entry property
>>> will be available to the DeleteEntry action via the mini-form.
>>>
>>> <display:column>
>>> <s:form action="DeleteEntry">
>>> <s:property value="entry"/>
>>> <s:hidden name="id" value="%{goalToAchieve.id}" />
>>> <s:submit value="Remove"/>
>>> </s:form>
>>> </display:column>
>>
>> What's that <s:property.../> supposed to be doing?
>>
>> It's not a form field; there's no entry reference being passed back. Even if
>> it *was* a form field it's still not passing a *reference* back--forms
>> *only* submit strings. Always. If you want an actual *entry* object there
>> either needs to be some type conversion, database retrieval, etc.
>>
>> Dave
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment:
user_200634.ezm (zipped)
Hello,
I've browsed nabble, google, ... but can't find a simple example on how to
do something very simple.
I need to iterate through, let's say, a picture category list, showing each
category as a s:checkbox. The picture belongs to some of these categories
(and user can changed that, or course, thanks to the checkboxes), so some of
the checkboxes must be pre-checked. Which of them are checked is shown in a
Integer[] (could be String[] if necesary, no problem). I guessed the right
way to do it is using a String or Integer array as checked values will be
sent to the struts2 action through that same property.
Is it that difficult to use s:checkbox for this? I know how to do it using
s:checkboxlist but can't here as I need special format in the iteration.
For some reason the following:
<s:iterator value="categoryTree">
<s:checkbox labelposition="right" name="categoryId" fieldValue="%{id}"
label="%{name}"/>
</s:iterator>
(categoryId is a Integer[] having which id values should be checked but all
checkboxes appear as checked)
For some reason I've found more people with this same problem but they got
no answers. Thanks for any example or ideas if I must change the way
pre-checked data is got from the action.
Ignacio
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200636.ezm (zipped)you need to specify the "value" attribute, which is the one that will
make it checked or not, for example, assume "possibleValues" is the
list of possible values, and "selectedValues" is the list of currently
selected values, and both lists contain objects that have an int "id"
field (same type of objects):
<s:iterator value="%{possibleValues}">
<s:checkbox name="categoryId" fieldValue="%{id}"
value="%{#selectedValues.contains(top)}" />
</s:iterator>
musachy
2009/7/12 Ignacio de Córdoba <icordoba@(protected)>:
>
> Hello,
> I've browsed nabble, google, ... but can't find a simple example on how to
> do something very simple.
>
> I need to iterate through, let's say, a picture category list, showing each
> category as a s:checkbox. The picture belongs to some of these categories
> (and user can changed that, or course, thanks to the checkboxes), so some of
> the checkboxes must be pre-checked. Which of them are checked is shown in a
> Integer[] (could be String[] if necesary, no problem). I guessed the right
> way to do it is using a String or Integer array as checked values will be
> sent to the struts2 action through that same property.
> Is it that difficult to use s:checkbox for this? I know how to do it using
> s:checkboxlist but can't here as I need special format in the iteration.
>
> For some reason the following:
> <s:iterator value="categoryTree">
> <s:checkbox labelposition="right" name="categoryId" fieldValue="%{id}"
> label="%{name}"/>
> </s:iterator>
>
> (categoryId is a Integer[] having which id values should be checked but all
> checkboxes appear as checked)
>
> For some reason I've found more people with this same problem but they got
> no answers. Thanks for any example or ideas if I must change the way
> pre-checked data is got from the action.
> Ignacio
> --
> View this message in context: http://www.nabble.com/s%3Acheckbox-inside-a-s%3Aiterator-and-values-in-a-Integer---tp24452969p24452969.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_200637.ezm (zipped)
Thanks a lot for reply. It works OK that way. I had to make a getter for the
Category objects as a List and maintain the setter for the categoryId
Integer array. It would be great if s:checkbox could also check when to
pre-check the checkbox in the same way as s:checkboxlist does (I think I
used s:checkboxlist getting checked fields from the Integer[] id getter. It
makes sense to use the same property to get checkbox status and to set
checkbox status)
Anyway, thanks a lot for your example.
Ignacio
Musachy Barroso wrote:
>
> you need to specify the "value" attribute, which is the one that will
> make it checked or not, for example, assume "possibleValues" is the
> list of possible values, and "selectedValues" is the list of currently
> selected values, and both lists contain objects that have an int "id"
> field (same type of objects):
>
> <s:iterator value="%{possibleValues}">
> <s:checkbox name="categoryId" fieldValue="%{id}"
> value="%{#selectedValues.contains(top)}" />
> </s:iterator>
>
> musachy
>
> 2009/7/12 Ignacio de Córdoba <icordoba@(protected)>:
>>
>> Hello,
>> I've browsed nabble, google, ... but can't find a simple example on how
>> to
>> do something very simple.
>>
>> I need to iterate through, let's say, a picture category list, showing
>> each
>> category as a s:checkbox. The picture belongs to some of these categories
>> (and user can changed that, or course, thanks to the checkboxes), so some
>> of
>> the checkboxes must be pre-checked. Which of them are checked is shown in
>> a
>> Integer[] (could be String[] if necesary, no problem). I guessed the
>> right
>> way to do it is using a String or Integer array as checked values will be
>> sent to the struts2 action through that same property.
>> Is it that difficult to use s:checkbox for this? I know how to do it
>> using
>> s:checkboxlist but can't here as I need special format in the iteration.
>>
>> For some reason the following:
>> <s:iterator value="categoryTree">
>> <s:checkbox labelposition="right" name="categoryId" fieldValue="%{id}"
>> label="%{name}"/>
>> </s:iterator>
>>
>> (categoryId is a Integer[] having which id values should be checked but
>> all
>> checkboxes appear as checked)
>>
>> For some reason I've found more people with this same problem but they
>> got
>> no answers. Thanks for any example or ideas if I must change the way
>> pre-checked data is got from the action.
>> Ignacio
>> --
>> View this message in context:
>> http://www.nabble.com/s%3Acheckbox-inside-a-s%3Aiterator-and-values-in-a-Integer---tp24452969p24452969.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200639.ezm (zipped)
Does anybody know?
or who can make a simple trial?
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200646.ezm (zipped)Hi,
We have migrated struts1 application to struts2. But now once we
deployed the system the CPU is going 90% to 100% and system is getting
loaded. In JSP's we are not using struts specific tags or freemaker
templates. Our JSP files are just plain jsp files only with
requstScope variables.
We are using following versions of struts and dependent libraries.
struts2-core-2.1.6.jar
struts2-codebehind-plugin-2.1.6.jar
ognl-2.6.11.jar
freemarker-2.3.13.jar
Please let me know if we can do any improvement with out switching
back to struts1
Kind Regards
Lasantha

Attachment:
user_200647.ezm (zipped)Hi!
I have html:select with countries list
I want to make sure that the user clicked on a value
Jsp:
<html:select styleClass="bg_FFF" style="width:80px" name="productBean"
property="data.category">
<html:option
value="empty">------</html:option>
<html:optionsCollection property="categoriesList" name="productBean"
value="id" label="name" />
</html:select>
validation.xm
<field property="data.category" depends="validwhen">
<arg key="choose category" resource="false"
/>
<var>
<var-name>test</var-name>
<var-value>
(*this* != 'empty')
</var-value>
</var>
</field>
But I don't see that it works! Why?

Attachment:
user_200648.ezm (zipped)Hello,
I am developing a web application that needs to allow uploading of file of
sizes ranging 200Mb - 1 GB. Currently, I'm doing this with the
FileUploadAction, which however loads the entire file in memory - as I
understood
I remember once I came across another possible solution, which allows the
serialization of the file data as it is received from the server.
Unfortunately, I can't find this reference anymore.
Anybody knows/has an hint about that?
Thanks,
Dan

Attachment:
user_200650.ezm (zipped)>
>
> I have successfully used the display tag to iterate over a collection
> which is exposed in an action class. On each row in addition to the
> columns displaying the fields of each object in the collection, I
> embed two more struts-tag urls: Update and Remove.
>
> The objective is to have an extra two columns for every row in the
> table giving the ability to update or delete each record:
>
> <display:table name="goalToAchieve.entries" requestURI="" uid="thisGoal">
> <display:column property="entry" />
> <display:column property="date" sortable="true"
> defaultorder="ascending" title="TimeStamp"/>
> <display:column><a href="<s:url action='UpdateEntryForm'>
> <s:param name="name"
> value="%{goalToAchieve.owner.fullName}" />
> </s:url>
> ">Edit</a></display:column>
> <display:column><a href="<s:url action='DeleteEntryForm'>
> <s:param name="name"
> value="%{goalToAchieve.owner.fullName}" />
> <s:property value="%{entry}"/>
> </s:url>
> ">Remove</a></display:column>
> </display:table>
>
> I am having trouble passing the entry property, (or reference to it)
> to the url targeting the update or delete action. The entries
> collection consists of value type, embeddable objects. I am aware of
> how to pass parameters to the linking url, but my issue is passing a
> reference to the "entry" property of each row, to the update or delete
> action for the same row.
>
>
You didn't say what 'entry' is, but if it is a String or some primitive you
can just pass it as another parameter.
<s:url action='DeleteEntryForm'>
<s:param name="name" value="%{goalToAchieve.owner.fullName}" />
<s:param name="entry" value="%{entry}" />
</s:url>
Usually, every database entity object has an 'id' property (primary key) and
you would just pass the id as a parameter so your action can find the object
in the database.
In you browser do a view source on the page to ensure the url is being
generated correctly with the params you are expecting.