Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 13 Jul 2009 15:50:44 -0000 Issue 8747

user-digest-help

2009-07-13


Author LoginPost Reply

user Digest 13 Jul 2009 15:50:44 -0000 Issue 8747

Topics (messages 200651 through 200665):

Re: <s:actionerrors> not displaying errors!
 200651 by: Greg Lindholm

Re: updating or deleting a component from a collection through display tag
 200652 by: Dimitrios Christodoulakis
 200655 by: Greg Lindholm
 200657 by: Dimitrios Christodoulakis
 200658 by: Greg Lindholm
 200659 by: Martin Gainty
 200660 by: Dimitrios Christodoulakis
 200661 by: Dimitrios Christodoulakis
 200665 by: Greg Lindholm

Re: Migration from Struts1 to Struts2
 200653 by: taj uddin
 200656 by: Lasantha Pambagoda
 200662 by: Martin Gainty

Re: "Nothing found to display" from display tag with struts 2
 200654 by: Wim De Smet

[Struts 2.1]Does an alias result exist in struts 2?
 200663 by: dcabasson
 200664 by: Musachy Barroso

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_200651.ezm (zipped)
If you want to preserve errors and messages across a redirect you can you
this interceptor:

http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/


On Sun, Jul 12, 2009 at 10:18 AM, taj uddin <tajuddin19@(protected):

> 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_200652.ezm (zipped)
Thanks for the reply. Well, entry is an instance of a separate 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 getters and setters

This being a value type embeddable component, it is represented with a
table with only a foreign key to the parent entity it belongs to:
goalToAchieve_id

So, if I pass the entry String as a parameter (I am not sure if it
would be convenient to have a a few sentences as url params), how can
I turn it into a reference to the object I want to actually remove
from the collection?

Thanks again

On Mon, Jul 13, 2009 at 8:17 AM, Greg Lindholm<greg.lindholm@(protected):
>>
>>
>> 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.
>


Attachment: user_200655.ezm (zipped)
>
> Thanks for the reply. Well, entry is an instance of a separate 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 getters and setters
>
> This being a value type embeddable component, it is represented with a
> table with only a foreign key to the parent entity it belongs to:
> goalToAchieve_id
>
> So, if I pass the entry String as a parameter (I am not sure if it
> would be convenient to have a a few sentences as url params), how can
> I turn it into a reference to the object I want to actually remove
> from the collection?
>
> Thanks again
>
> > 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.
> >
>

You definitely do not want to pass 'entry' as a parameter on the url.
Every database object needs some kind of unique key id just for situations
like this.
Maybe you could use the insertDate as a key (it's probably unique within
this context) but it would be better to add a key, perhaps a sequence number
so that goalToAchieve_id + seq is the PK.

Attachment: user_200657.ezm (zipped)
Yes, that is a great suggestion actually. What I did was to add a new
field based
System.currentTimeMillis(), but the problem is adding it as a url parameter.

For example, I am trying to add it as a url parameter below:

<a href="<s:url action='UpdateEntryForm'>
<s:param name="name" value="%{goalToAchieve.owner.fullName}" />
<s:param name="mark" value="%{mark}" />
</s:url>
">Edit</a>

But, the only param passed is the fullName. The mark is not added to
the url string. I think this is because the only object available on
the valuestack is goalToAchieve, and using deeper notation I can
reference as deep as the "entries" collection. But not to fields of
each entry object. In other words, the display or iterator help me
view the collection objects, but not extract and use any of their
fields... I am not sure why this is happening, or if I am doing
something wrong.

On Mon, Jul 13, 2009 at 8:43 AM, Greg Lindholm<greg.lindholm@(protected):
>>
>> Thanks for the reply. Well, entry is an instance of a separate class:
>>
>> @Embeddable
>> public class JournalEntry {
>> @org.hibernate.annotations.Parent
>>        private GoalToAchieve goalToAchieve;
>> @Column(length = 255, nullable = false)
>>        private String entry;
>>
>>        @(protected))
>>        @(protected))
>>        private Date insertDate = new Date();
>>
>> ...plus the getters and setters
>>
>> This being a value type embeddable component, it is represented with a
>> table with only a foreign key to the parent entity it belongs to:
>> goalToAchieve_id
>>
>> So, if I pass the entry String as a parameter (I am not sure if it
>> would be convenient to have a a few sentences as url params), how can
>> I turn it into a reference to the object I want to actually remove
>> from the collection?
>>
>> Thanks again
>>
>> > 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.
>> >
>>
>
> You definitely do not want to pass 'entry' as a parameter on the url.
> Every database object needs some kind of unique key id just for situations
> like this.
> Maybe you could use the insertDate as a key (it's probably unique within
> this context) but it would be better to add a key, perhaps a sequence number
> so that goalToAchieve_id + seq is the PK.
>


Attachment: user_200658.ezm (zipped)
You are not providing enough information for anyone to help you. Since you
have changed your object and the jsp you had better include them with any
request.


On Mon, Jul 13, 2009 at 9:51 AM, Dimitrios Christodoulakis <
dimi.chr@(protected):

> Yes, that is a great suggestion actually. What I did was to add a new
> field based
> System.currentTimeMillis(), but the problem is adding it as a url
> parameter.
>
> For example, I am trying to add it as a url parameter below:
>
> <a href="<s:url action='UpdateEntryForm'>
> <s:param name="name" value="%{goalToAchieve.owner.fullName}" />
> <s:param name="mark" value="%{mark}" />
> </s:url>
> ">Edit</a>
>
> But, the only param passed is the fullName. The mark is not added to
> the url string. I think this is because the only object available on
> the valuestack is goalToAchieve, and using deeper notation I can
> reference as deep as the "entries" collection. But not to fields of
> each entry object. In other words, the display or iterator help me
> view the collection objects, but not extract and use any of their
> fields... I am not sure why this is happening, or if I am doing
> something wrong.
>

Attachment: user_200659.ezm (zipped)

@Table(name = "TableNameGoesHere")

//the java file would use ForeignKey annotation as described
@org.hibernate.annotations.ForeignKey(name = "FK_GOALTOACHIEVE_ID")

public class WikiDocument extends WikiFile<WikiDocument> implements Serializable {
  public String getHistoricalEntityName() {
    return "HistoricalWikiDocument";
  }

and the hibernate configuration file (DatabaseObjects.hbm.xml) would handle the SequenceGeneration

<hibernate-mapping package="org.jboss.seam.wiki.core.model" default-access="field">
  <class name="WikiDocument" entity-name="HistoricalWikiDocument" table="TABLE_NAME_GOES_HERE" polymorphism="explicit">
    <id name="PrimaryKey_In_Java_File" column="PRIMARY_KEY_ID">
       <generator class="org.hibernate.id.enhanced.SequenceStyleGenerator">
          <param name="sequence_name">TABLE_NAME_PRIMARY_KEY__SEQUENCE</param>
       </generator>
    </id>

WARNING: Despite (albeit brief) commentary offered
any attempts to provide SEQUENCE generation to subvert SEQUENCE GENERATION by DBA is discouraged ..you do'nt want 2 sequences on same Table
i would encourage you to coordinate your SEQUENCE generation activity with DBA

fwiw
Martin Gainty
______________________________________________
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: Mon, 13 Jul 2009 09:43:15 -0400
> Subject: Re: updating or deleting a component from a collection through  display tag
> From: greg.lindholm@(protected)
> To: user@(protected)
>
> >
> > Thanks for the reply. Well, entry is an instance of a separate 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 getters and setters
> >
> > This being a value type embeddable component, it is represented with a
> > table with only a foreign key to the parent entity it belongs to:
> > goalToAchieve_id
> >
> > So, if I pass the entry String as a parameter (I am not sure if it
> > would be convenient to have a a few sentences as url params), how can
> > I turn it into a reference to the object I want to actually remove
> > from the collection?
> >
> > Thanks again
> >
> > > 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.
> > >
> >
>
> You definitely do not want to pass 'entry' as a parameter on the url.
> Every database object needs some kind of unique key id just for situations
> like this.
> Maybe you could use the insertDate as a key (it's probably unique within
> this context) but it would be better to add a key, perhaps a sequence number
> so that goalToAchieve_id + seq is the PK.

_________________________________________________________________
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290

Attachment: user_200660.ezm (zipped)
Thanks for letting me know. Alright, so:

This is the parent class:

@Entity
public class GoalToAchieve {
@Id @GeneratedValue
private Long id;
 
@org.hibernate.annotations.CollectionOfElements
@JoinTable (name="GoalToAchieve_entry",
joinColumns=@(protected)"))
private Set<JournalEntry> entries = new HashSet<JournalEntry>();
 
 public Set<JournalEntry> getEntries() {
   return entries;
 }
 public void setEntries(SortedSet<JournalEntry> entries) {
   this.entries = entries;
 }
 
 public void addEntry(JournalEntry newEntry){
   entries.add(newEntry);
 }
 
 public void deleteEntry(JournalEntry entry){
   entries.remove(entry);
 }
..plus some other standard fields with getters and setters

This is the child-class:

@Embeddable
public class JournalEntry {
@org.hibernate.annotations.Parent
private GoalToAchieve goalToAchieve;
 
@Column
private Long mark;
public Long getMark() {
 return mark;
}
public void setMark(long mark){
 this.mark = mark;
 }
 
@Column(length = 255, nullable = false)
private String entry;
 
@Temporal(TemporalType.TIMESTAMP)
@Column(nullable = false, updatable = false)
private Date insertDate = new Date();

..plus the rest getters and setters

And this this the jsp part where I display the collection:

<s:if test="goalToAchieve.entries.size > 0">
<display:table name="goalToAchieve.entries" requestURI="" uid="thisGoal">
   <display:column property="entry" />
   <display:column property="date" sortable="true"
defaultorder="ascending" title="TimeStamp"/>
 <display:column property="mark" />
<display:column>
<a href="<s:url action='UpdateEntryForm'>
   <s:param name="name" value="%{goalToAchieve.owner.fullName}" />
   <s:param name="mark" value="#mark" />
  </s:url>
  ">Edit</a>
</display:column>
<display:column>
<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="entry.mark" />
 <s:property value="%{entry}"/>
  </s:url>
">Remove</a>  
</display:column>
</display:table>
</s:if>

..and the delete action, which should take an entry reference and
remove it from the collections looks like this:

public class DeleteEntry extends ActionSupport{
public String execute(){
   goalToAchieve.deleteEntry(entry);
   
   return SUCCESS;
 }
 
 private JournalEntry entry;
 private GoalToAchieve goalToAchieve;
 private long id;

... + getters and setters

I guess right now, my problem has become how to pass a parameter
referring to en entry (the mark field) to the delete action. Next, I
would do a lookup within the action to find the entry object and
remove it from the parent object collection, by calling
deleteEntry(JournalEntry entry)

On Mon, Jul 13, 2009 at 9:16 AM, Greg Lindholm<greg.lindholm@(protected):
> You are not providing enough information for anyone to help you. Since you
> have changed your object and the jsp you had better include them with any
> request.
>
>
> On Mon, Jul 13, 2009 at 9:51 AM, Dimitrios Christodoulakis <
> dimi.chr@(protected):
>
>> Yes, that is a great suggestion actually. What I did was to add a new
>> field based
>> System.currentTimeMillis(), but the problem is adding it as a url
>> parameter.
>>
>> For example, I am trying to add it as a url parameter below:
>>
>> <a href="<s:url action='UpdateEntryForm'>
>> <s:param name="name" value="%{goalToAchieve.owner.fullName}" />
>> <s:param name="mark" value="%{mark}" />
>> </s:url>
>>  ">Edit</a>
>>
>> But, the only param passed is the fullName. The mark is not added to
>> the url string. I think this is because the only object available on
>> the valuestack is goalToAchieve, and using deeper notation I can
>> reference as deep as the "entries" collection. But not to fields of
>> each entry object. In other words, the display or iterator help me
>> view the collection objects, but not extract and use any of their
>> fields... I am not sure why this is happening, or if I am doing
>> something wrong.
>>
>


Attachment: user_200661.ezm (zipped)
Thanks for the comments Martin, I will try it out!

On Mon, Jul 13, 2009 at 9:46 AM, Martin Gainty<mgainty@(protected):
>
> @Table(name = "TableNameGoesHere")
>
> //the java file would use ForeignKey annotation as described
> @org.hibernate.annotations.ForeignKey(name = "FK_GOALTOACHIEVE_ID")
>
> public class WikiDocument extends WikiFile<WikiDocument> implements Serializable {
>    public String getHistoricalEntityName() {
>        return "HistoricalWikiDocument";
>    }
>
> and the hibernate configuration file (DatabaseObjects.hbm.xml) would handle the SequenceGeneration
>
> <hibernate-mapping package="org.jboss.seam.wiki.core.model" default-access="field">
>    <class name="WikiDocument" entity-name="HistoricalWikiDocument" table="TABLE_NAME_GOES_HERE" polymorphism="explicit">
>        <id name="PrimaryKey_In_Java_File" column="PRIMARY_KEY_ID">
>            <generator class="org.hibernate.id.enhanced.SequenceStyleGenerator">
>                <param name="sequence_name">TABLE_NAME_PRIMARY_KEY__SEQUENCE</param>
>            </generator>
>        </id>
>
> WARNING: Despite (albeit brief) commentary offered
> any attempts to provide SEQUENCE generation to subvert SEQUENCE GENERATION by DBA is discouraged ..you do'nt want 2 sequences on same Table
> i would encourage you to coordinate your SEQUENCE generation activity with DBA
>
> fwiw
> Martin Gainty
> ______________________________________________
> 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: Mon, 13 Jul 2009 09:43:15 -0400
>> Subject: Re: updating or deleting a component from a collection through       display tag
>> From: greg.lindholm@(protected)
>> To: user@(protected)
>>
>> >
>> > Thanks for the reply. Well, entry is an instance of a separate class:
>> >
>> > @Embeddable
>> > public class JournalEntry {
>> > @org.hibernate.annotations.Parent
>> >        private GoalToAchieve goalToAchieve;
>> > @Column(length = 255, nullable = false)
>> >        private String entry;
>> >
>> >        @(protected))
>> >        @(protected))
>> >        private Date insertDate = new Date();
>> >
>> > ...plus the getters and setters
>> >
>> > This being a value type embeddable component, it is represented with a
>> > table with only a foreign key to the parent entity it belongs to:
>> > goalToAchieve_id
>> >
>> > So, if I pass the entry String as a parameter (I am not sure if it
>> > would be convenient to have a a few sentences as url params), how can
>> > I turn it into a reference to the object I want to actually remove
>> > from the collection?
>> >
>> > Thanks again
>> >
>> > > 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.
>> > >
>> >
>>
>> You definitely do not want to pass 'entry' as a parameter on the url.
>> Every database object needs some kind of unique key id just for situations
>> like this.
>> Maybe you could use the insertDate as a key (it's probably unique within
>> this context) but it would be better to add a key, perhaps a sequence number
>> so that goalToAchieve_id + seq is the PK.
>
> _________________________________________________________________
> Lauren found her dream laptop. Find the PC that’s right for you.
> http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290


Attachment: user_200665.ezm (zipped)
Looks like you need to change entry.mark to just mark and remove the
<s:property value="%{entry}"/>. Also you probably don't need to pass both
the name and id of the parent object.

<a href="<s:url action='DeleteEntryForm' var="entry" escapeAmp="false">
    <s:param name="id" value="%{goalToAchieve.id}" />
    <s:param name="mark" value="%{mark}" />
 </s:url>
">Remove</a>


On Mon, Jul 13, 2009 at 10:48 AM, Dimitrios Christodoulakis <
dimi.chr@(protected):

> Thanks for letting me know. Alright, so:
>
> This is the parent class:
>
> @Entity
> public class GoalToAchieve {
> @Id @GeneratedValue
> private Long id;
>
> @org.hibernate.annotations.CollectionOfElements
> @JoinTable (name="GoalToAchieve_entry",
> joinColumns=@(protected)"))
> private Set<JournalEntry> entries = new HashSet<JournalEntry>();
>
>     public Set<JournalEntry> getEntries() {
>           return entries;
>     }
>     public void setEntries(SortedSet<JournalEntry> entries) {
>           this.entries = entries;
>     }
>
>     public void addEntry(JournalEntry newEntry){
>           entries.add(newEntry);
>     }
>
>     public void deleteEntry(JournalEntry entry){
>           entries.remove(entry);
>     }
> ..plus some other standard fields with getters and setters
>
> This is the child-class:
>
> @Embeddable
> public class JournalEntry {
> @org.hibernate.annotations.Parent
> private GoalToAchieve goalToAchieve;
>
> @Column
> private Long mark;
> public Long getMark() {
>     return mark;
> }
> public void setMark(long mark){
>     this.mark = mark;
>      }
>
> @Column(length = 255, nullable = false)
> private String entry;
>
> @Temporal(TemporalType.TIMESTAMP)
> @Column(nullable = false, updatable = false)
> private Date insertDate = new Date();
>
> ..plus the rest getters and setters
>
> And this this the jsp part where I display the collection:
>
> <s:if test="goalToAchieve.entries.size > 0">
> <display:table name="goalToAchieve.entries" requestURI="" uid="thisGoal">
>     <display:column property="entry" />
>     <display:column property="date" sortable="true"
> defaultorder="ascending" title="TimeStamp"/>
>     <display:column property="mark" />
> <display:column>
> <a href="<s:url action='UpdateEntryForm'>
>     <s:param name="name" value="%{goalToAchieve.owner.fullName}" />
>     <s:param name="mark" value="#mark" />
>   </s:url>
>   ">Edit</a>
> </display:column>
> <display:column>
> <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="entry.mark" />
>     <s:property value="%{entry}"/>
>   </s:url>
> ">Remove</a>
> </display:column>
> </display:table>
> </s:if>
>
> ..and the delete action, which should take an entry reference and
> remove it from the collections looks like this:
>
> public class DeleteEntry extends ActionSupport{
> public String execute(){
>           goalToAchieve.deleteEntry(entry);
>
>           return SUCCESS;
>     }
>
>     private JournalEntry entry;
>     private GoalToAchieve goalToAchieve;
>     private long id;
>
> ... + getters and setters
>
> I guess right now, my problem has become how to pass a parameter
> referring to en entry (the mark field) to the delete action. Next, I
> would do a lookup within the action to find the entry object and
> remove it from the parent object collection, by calling
> deleteEntry(JournalEntry entry)
>
> On Mon, Jul 13, 2009 at 9:16 AM, Greg Lindholm<greg.lindholm@(protected)>
> wrote:
> > You are not providing enough information for anyone to help you. Since
> you
> > have changed your object and the jsp you had better include them with any
> > request.
> >
> >
> > On Mon, Jul 13, 2009 at 9:51 AM, Dimitrios Christodoulakis <
> > dimi.chr@(protected):
> >
> >> Yes, that is a great suggestion actually. What I did was to add a new
> >> field based
> >> System.currentTimeMillis(), but the problem is adding it as a url
> >> parameter.
> >>
> >> For example, I am trying to add it as a url parameter below:
> >>
> >> <a href="<s:url action='UpdateEntryForm'>
> >> <s:param name="name" value="%{goalToAchieve.owner.fullName}" />
> >> <s:param name="mark" value="%{mark}" />
> >> </s:url>
> >> ">Edit</a>
> >>
> >> But, the only param passed is the fullName. The mark is not added to
> >> the url string. I think this is because the only object available on
> >> the valuestack is goalToAchieve, and using deeper notation I can
> >> reference as deep as the "entries" collection. But not to fields of
> >> each entry object. In other words, the display or iterator help me
> >> view the collection objects, but not extract and use any of their
> >> fields... I am not sure why this is happening, or if I am doing
> >> something wrong.
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_200653.ezm (zipped)
I'm not sure but do pls check out by including the sitemesh-2.3.jar file and xwork-2.0.6.jar file in your library

--- On Mon, 7/13/09, Lasantha Pambagoda <lpambagoda@(protected):


From: Lasantha Pambagoda <lpambagoda@(protected)>
Subject: Migration from Struts1 to Struts2
To: user@(protected)
Date: Monday, July 13, 2009, 6:33 AM


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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)




   

Attachment: user_200656.ezm (zipped)
Dear Uddin,

Thanks for the reply. But we are are already included xwork-2.1.2.jar
and we are not using any sitemesh features in out project. Anyhow I
have included sitemesh jar file and still no difference.

Best Regards
Lasantha

On Mon, Jul 13, 2009 at 5:31 PM, taj uddin<tajuddin19@(protected):
> I'm not sure but do pls check out by including the sitemesh-2.3.jar file and xwork-2.0.6.jar file in your library
>
> --- On Mon, 7/13/09, Lasantha Pambagoda <lpambagoda@(protected):
>
>
> From: Lasantha Pambagoda <lpambagoda@(protected)>
> Subject: Migration from Struts1 to Struts2
> To: user@(protected)
> Date: Monday, July 13, 2009, 6:33 AM
>
>
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
>


Attachment: user_200662.ezm (zipped)

take a look at tuning tips described at
http://cwiki.apache.org/WW/performance-tuning.html

ping back for questions/concerns
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: Mon, 13 Jul 2009 06:31:34 -0700
> From: tajuddin19@(protected)
> Subject: Re: Migration from Struts1 to Struts2
> To: user@(protected)
>
> I'm not sure but do pls check out by including the sitemesh-2.3.jar file and xwork-2.0.6.jar file in your library
>
> --- On Mon, 7/13/09, Lasantha Pambagoda <lpambagoda@(protected):
>
>
> From: Lasantha Pambagoda <lpambagoda@(protected)>
> Subject: Migration from Struts1 to Struts2
> To: user@(protected)
> Date: Monday, July 13, 2009, 6:33 AM
>
>
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
>    

_________________________________________________________________
Bing™ finds low fares by predicting when to book. Try it now.
http://www.bing.com/travel/deals/airline-ticket-deals.do?form=MTRHPG&publ=WLHMTAG&crea=TXT_MTRHPG_Travel_Travel_TravelDeals_1x1

Attachment: user_200654.ezm (zipped)
Hi,

I think this is a bit odd as I'm using the display tag (1.2) with
struts 2 (2.1.6) and I can't get it to work without using <s:set />.
Are there any special interceptors or anything one needs to have
enabled for this to work? I think I have the default stack on that
particular page so I assume the tag should be working but it doesn't.
The list is set on the action as usual and works when iterating and
when using <s:set />.

regards,
Wim

On Sat, Jul 11, 2009 at 7:26 PM, dusty<dustin_pearce@(protected):
>
> That sounds like a troubling one, based on what you describe it should work.
> Especially if the struts iterator works on the same JSP page.   What version
> of Struts and DisplayTag are you using.
>
> There was a time when you had to use the <s:set /> tag and a time when you
> did not.  Have you tried without the s:set tag?
>
>
>
> Dimitrios Christodoulakis wrote:
>>
>> Hello list,
>>
>> I am exposing a collection called "entries" in my action class
>> (Set<JournalEntry> entries;), with all the appropriate getters and
>> setters. In the result jsp of this action I am using the display tag
>> to output the content of the collection:
>>
>> <s:set name="entries" value="entries" scope="request"/>
>>               <display:table name="entries" requestURI="">
>>                       <display:column property="entry"/>
>>                       <display:column property="date" sortable="true"
>> defaultorder="ascending"/>
>>               </display:table>
>>
>> But the message I get on the jsp page is: "Nothing found to display".
>> (Its not an exception, this message is printed on the regulat html
>> output page). I am certain that the rows exist on the underlying db, I
>> am using mysql query browser to check.
>>
>> So, I have followed instructions about struts2 and the display tag
>> found in different places:
>> http://www.nabble.com/Struts-2---DisplayTag-example-td17694341.html
>> http://www.manning-sandbox.com/thread.jspa?messageID=76885
>> http://appfuse.org/display/APF/Using+Struts+2
>>
>> But I can't get this simple task to work. The objective is to simply
>> display the table. In contrast, using just the struts2 tags, the
>> following works fine:
>>
>> <table border="3">
>>                       <s:iterator value="entries">
>>                               <tr />
>>                                       <td><s:property value="entry"/></td>
>>                                       <td><s:property value="date"/></td>
>>                               </tr>
>>                       </s:iterator>
>>               </table>
>>
>> However, since I wish to use the display tag for further formatting
>> and sorting, I was hoping if anyone had any thoughts as to why my code
>> above finds nothing to display. I can't tell if it finds just an empty
>> collection, or doesn't find the collection at all.
>>
>> thanks for any advice.
>>
>> Regards.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/%22Nothing-found-to-display%22-from-display-tag-with-struts-2-tp24441738p24442243.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)
>
>


Attachment: user_200663.ezm (zipped)

Hi all,

I am wondering if there is an "alias" result in struts 2.

The use case for such a result type would be for when some of the results
are the same. Say SUCCESS and INPUT actually go both to the same location,
it would be nice to be able to define SUCCESS and have INPUT be only an
alias of SUCCESS.

An even more specific use of that result would be when you define a global
result in the struts 2 configuration (say HOME), and you want the INPUT
result to point to this global result of HOME. You have to name your result
INPUT on that action, for validation purposes, but currently you have no way
of telling struts this INPUT result is only an alias of the gloabl HOME
result.

Does that make sense to you guys? Is that worth entering a JIRA ticket for
that enhancement?

Thanks!
Denis.
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_200664.ezm (zipped)
I think the only way to do that currently, is to define the 2 results
with the same location.

musachy

On Mon, Jul 13, 2009 at 8:13 AM, dcabasson<denis.cabasson@(protected):
>
> Hi all,
>
> I am wondering if there is an "alias" result in struts 2.
>
> The use case for such a result type would be for when some of the results
> are the same. Say SUCCESS and INPUT actually go both to the same location,
> it would be nice to be able to define SUCCESS and have INPUT be only an
> alias of SUCCESS.
>
> An even more specific use of that result would be when you define a global
> result in the struts 2 configuration (say HOME), and you want the INPUT
> result to point to this global result of HOME. You have to name your result
> INPUT on that action, for validation purposes, but currently you have no way
> of telling struts this INPUT result is only an alias of the gloabl HOME
> result.
>
> Does that make sense to you guys? Is that worth entering a JIRA ticket for
> that enhancement?
>
> Thanks!
> Denis.
> --
> View this message in context: http://www.nabble.com/-Struts-2.1-Does-an-alias-result-exist-in-struts-2--tp24463634p24463634.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

©2008 gg3721.com - Jax Systems, LLC, U.S.A.