Author Login
Post Reply
user Digest 21 Apr 2008 07:44:28 -0000 Issue 7990
Topics (messages 185645 through 185655):
Re: Intenationalization questions
185645 by: Jeromy Evans
185650 by: Pranav
185654 by: Jeromy Evans
Re: Can these two co exists
185646 by: Jeromy Evans
185647 by: Chris Pratt
Re: Clearing form value
185648 by: Nils-Helge Garli Hegvik
185649 by: aum strut
185652 by: Nils-Helge Garli Hegvik
Re: Struts 2 AJAX editable grid
185651 by: tom tom
185653 by: Jeromy Evans
Re: Problem with internationalization in addActionError
185655 by: volker.magiccode.eu
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_185645.ezm (zipped)Pranav wrote:
> Hi,
>
>
> Now my questions are:
> 1) If I do the above, do I always have to use the getText way of looking up the messages? If I use the key attribute of the UI tags, will the overridden getText methods be still called?
>
Yes. The Struts2 tags with a key attribute and the s:text tag call the
get getText(...) methods of the first TextProvider encountered in the
stack. This is usually your action if you extended ActionSupport. Note
that if you use the i18n tag it won't work as that tag creates an
alternative TextProvider in front of your action.
> 2) Also is there any major problem with the approach above to solve the particular prolem I am having?
>
>
It seems appropriate for a small number of customers. Create a custom
TextProvider and delegate to it from your new base class, providing the
customer-specific key.
If this needs to scale out to a large number of customers, change your
TextProvider implementation to load a resource bundle for each customer
and a default resource bundle (ie. don't use customer specific keys; use
customer-specific bundles that take precedence over the default
values). Eventually you'll also be able to switch to database-backed
resource bundles to add custom customers dynamically if the need arises.
Hope that helps,
Jeromy Evans

Attachment:
user_185650.ezm (zipped)Thanks for the reply.
So, for a scalability, you suggest that I should change TextProvider implementation to load a resource bundle for each customer. I don't exactly know how to tell it to load a customer specific resource bundle. I mean which methods to override for doing this. And also how to associate this custom TextProvider to my BaseActionSupport class.
Thanks
Pranav
----- Original Message ----
From: Jeromy Evans <jeromy.evans@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Sunday, April 20, 2008 9:07:52 PM
Subject: Re: Intenationalization questions
Pranav wrote:
> Hi,
>
>
> Now my questions are:
> 1) If I do the above, do I always have to use the getText way of looking up the messages? If I use the key attribute of the UI tags, will the overridden getText methods be still called?
>
Yes. The Struts2 tags with a key attribute and the s:text tag call the
get getText(...) methods of the first TextProvider encountered in the
stack. This is usually your action if you extended ActionSupport. Note
that if you use the i18n tag it won't work as that tag creates an
alternative TextProvider in front of your action.
> 2) Also is there any major problem with the approach above to solve the particular prolem I am having?
>
>
It seems appropriate for a small number of customers. Create a custom
TextProvider and delegate to it from your new base class, providing the
customer-specific key.
If this needs to scale out to a large number of customers, change your
TextProvider implementation to load a resource bundle for each customer
and a default resource bundle (ie. don't use customer specific keys; use
customer-specific bundles that take precedence over the default
values). Eventually you'll also be able to switch to database-backed
resource bundles to add custom customers dynamically if the need arises.
Hope that helps,
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Attachment:
user_185654.ezm (zipped)Pranav wrote:
> Thanks for the reply.
> So, for a scalability, you suggest that I should change TextProvider implementation to load a resource bundle for each customer. I don't exactly know how to tell it to load a customer specific resource bundle. I mean which methods to override for doing this. And also how to associate this custom TextProvider to my BaseActionSupport class.
>
>
Second question first: Take a look at the code for ActionSupport.
You'll see it creates a TextProvider instance and all the getText(...)
methods delegate to it. Your base action should create your own
alternative TextSupport instance.
First question:
The Default TextProvider in Struts2 uses XWork's LocalizedTextUtils to
search for resource bundles based on the classname and locale. It's
designed for flexibility and tries every imaginable combination of class
name, interfaces and package name as the baseName for the bundle (eg.
actionName.properties, interfaceName.properties, packageName.properties
etc etc etc). For each attempt, it eventually calls
java.util.ResourceBundle.getBundle(baseName, Locale, ClassLoader).
Your customized TextProvider would use it's own baseName algorithm like:
customerKey-packageName
packageName
and call ResourceBundle.getBundle(baseName, Locale, ClassLoader). Have
a look at the source of the DefaultTextProvider as a guide.
Instead of duplicating every key for each new customer, I would attempt
to load two resource bundles - the default, and then the custom-specific
resource bundle to overrides just the necessary properties (or delegate
to the DefaultTextProvider if not custom bundle was found)
If you're using Spring, you'll find it has some good tools for
managing/finding resource bundles.
regards,
Jeromy Evans

Attachment:
user_185646.ezm (zipped)tom tom wrote:
> Hi,
>
> We have portlet based ajax application written using
> struts 2.0.6, With the introduction of the struts
> 2.0.11 we can see lot of bugs have been resolved.
>
> We would like to start the next project using struts
> 2.0.11, both application will co exist in the same
> tomcat server.
>
> Will there be any class loading or any other issue if
> we have struts 2.0.6 and struts 2.0.11 application in
> the same tomcat server.
>
> Thanks
>
>
That will be fine. Tomcat uses a different classloader for each webapp.
Conflicts occur only when you place jars in Tomcat's shared, common or
system library folders. See the first section of their how-to:
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

Attachment:
user_185647.ezm (zipped)Ok, sorry to be off topic, but does it strike anyone else as ironic
that a a conversation entitled "Can these two coexist" was written by
TOM & JERomY?
(*Chris*)
On Sun, Apr 20, 2008 at 9:19 PM, Jeromy Evans
<jeromy.evans@(protected):
> tom tom wrote:
>
> > Hi,
> >
> > We have portlet based ajax application written using
> > struts 2.0.6, With the introduction of the struts
> > 2.0.11 we can see lot of bugs have been resolved.
> >
> > We would like to start the next project using struts
> > 2.0.11, both application will co exist in the same
> > tomcat server.
> >
> > Will there be any class loading or any other issue if
> > we have struts 2.0.6 and struts 2.0.11 application in
> > the same tomcat server.
> >
> > Thanks
> >
> >
> >
>
> That will be fine. Tomcat uses a different classloader for each webapp.
>
> Conflicts occur only when you place jars in Tomcat's shared, common or
> system library folders. See the first section of their how-to:
> http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185648.ezm (zipped)I don't see why that should prevent you from doing a redirect?
Nils-H
On Mon, Apr 21, 2008 at 5:44 AM, aum strut <aum.struts@(protected):
> Nils
>
> though i have achieved this using javascript
> my problem was that i can not redirect as i have to enter multipal records
> at a given time
>
>
>
>
> On 4/20/08, Nils-Helge Garli Hegvik <nilsga@(protected):
> >
> > Considering you're processing the form and displaying the form using
> > the same action within the same request, I would say this is expected
> > behavior. I would consider doing a redirect after the post instead.
> >
> > Nils-H
> >
> > On Sat, Apr 19, 2008 at 12:06 PM, aum strut <aum.struts@(protected):
> > > i am not using Spring at all.here is the code for my configuration and
> > > action class
> > >
> > > my *Quotation.jsp page* by which i am adding data
> > >
> > >
> > > <%@(protected)" %>
> > >
> > > <html>
> > >
> > > <head>
> > >
> > > <title>Quotation Form</title>
> > >
> > > <s:head theme="ajax"/>
> > >
> > > </head>
> > >
> > > <body>
> > >
> > > <center><font face="verdana" size="2" color="red"><s:actionmessage></
> > > s:actionmessage></font></center>
> > >
> > > <h1 align="center"> Quotation Form</h1>
> > >
> > > <s:form action="SaveBill">
> > >
> > > <table align="center">
> > >
> > > <s:datetimepicker label="Date:" name="date"/></td><td>
> > >
> > > <s:textfield label="Voucher Number:" name="voucherNumber"/>
> > >
> > > <s:textfield label="Customer Name:" name="customerName"/>
> > >
> > > <s:textarea label="Address" name="address" cols="20" rows="4"/>
> > >
> > > <s:textfield label="Contact No:" name="contactNo"/>
> > >
> > > <s:textfield label="Item Name:" name="itemName"/>
> > >
> > > <s:textfield label="Purity:" name="purity"/>
> > >
> > > <s:textfield label="Gross Weight(Gms):" name="grossWeight"/>
> > >
> > > <s:textfield label="Net Weight(Gms):" name="netWeight"/>
> > >
> > > <s:textfield label="Diamond Weight:" name="diamondWeight"/>
> > >
> > > <s:textfield label="Gold Rate(Rs):" name="goldRate"/>
> > >
> > > <s:textfield label="Amount:" name="amount"/>
> > >
> > > <s:submit label="Save" align="center" />
> > >
> > > </table>
> > >
> > > </s:form>
> > >
> > > </body>
> > >
> > > </html>
> > > *my action class*
> > >
> > >
> > > package raisonne.billgeneration;
> > >
> > > import
com.opensymphony.xwork2.ActionSupport;
> > > import raisonne.billgeneration.GetBillConnection;
> > >
> > > public class SaveBillingData extends ActionSupport{
> > >
> > > /**
> > > *
> > > */
> > > private static final long serialVersionUID = -5856152810070496725L;
> > > private int rowInserted=0;
> > > private String date=null;
> > > private String voucherNumber=null;
> > > private String customerName=null;
> > > private String address=null;
> > > private String contactNo=null;
> > > private String itemName=null;
> > > private String purity=null;
> > > private double grossWeight=0.0;
> > > private double netWeight=0.0;
> > > private double diamondWeight=0.0;
> > > private double goldRate=0.0;
> > > private double amount=0.0;
> > >
> > > /*
> > >
> > > Getter and Setter Method
> > >
> > > */
> > >
> > > public String execute() throws Exception{
> > > GetBillConnection billCollection =new GetBillConnection();
> > >
> > rowInserted=billCollection.AddBillingData(getDate(),getVoucherNumber(),
> > > getCustomerName(),getAddress(),getContactNo(),
> > > getItemName(),getPurity(),getGrossWeight(),
> > > getNetWeight(),getDiamondWeight(),getGoldRate(),getAmount());
> > > if(rowInserted>0){
> > > addActionMessage("Quotation data has been submitted successfully");
> > > return SUCCESS;
> > > }
> > > else{
> > > addActionMessage("Error while saving Quotation data, Pleaes retry");
> > > return INPUT;
> > > }
> > > }
> > >
> > >
> > > }
> > >
> > >
> > > lastly *Struts.xml file*
> > >
> > >
> > > <package name="raisonne.billgeneration" extends="struts-default"
> > namespace=
> > > "/">
> > >
> > > <action name="SaveBill"
> > class="raisonne.billgeneration.SaveBillingData">
> > >
> > > <result name="success">/BillGeneration/Quotation.jsp</result>
> > >
> > > <result name="input">/Login/Login.jsp</result>
> > >
> > > </action>
> > >
> > > </package>
> > > -aum
> > >
> > >
> > >
> > >
> > > On 4/19/08, Nils-Helge Garli Hegvik <nilsga@(protected):
> > > >
> > > > It would be a lot easier helping if you show us some configuration
> > > > files and code....
> > > >
> > > > Nils-H
> > > >
> > > > On Sat, Apr 19, 2008 at 6:59 AM, aum strut <aum.struts@(protected)>
> > wrote:
> > > > > yes you are right
> > > > >
> > > > > not providing complete information in one mail is really not good
> > > > >
> > > > > i wil take this in to account in future...
> > > > >
> > > > > well i am not using spring in my application i have a simple form
> > which
> > > > is
> > > > > sending the input values to my action where i am adding these in
> > to the
> > > > data
> > > > > base using simple jdbc call everything is working fine i am even
> > > > getting
> > > > > back the success response in my add form.
> > > > >
> > > > > i am not able to understand what u mean by "not have your action
> > > > defined as
> > > > > being "prototype"
> > > > > scope"
> > > > >
> > > > > aum
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > > > >
> > > > > > Are you using Spring?
> > > > > >
> > > > > > Would it be possible for you to provide more useful information
> > in
> > > > your
> > > > > > initial emails rather than generating a stream of a half-dozen
> > or
> > > > more?
> > > > > > It's
> > > > > > rather frustrating; we've gone through this before.
> > > > > >
> > > > > > One common error is to not have your action defined as being
> > > > "prototype"
> > > > > > scope. Since actions are instantiated on each request (normally)
> > it's
> > > > not
> > > > > > typical to see this behavior without some effort on your part or
> > > > > > mis-configuration.
> > > > > >
> > > > > > Dave
> > > > > >
> > > > > > --- aum strut <aum.struts@(protected):
> > > > > >
> > > > > > > currently i am using struts-2.0.11.1
> > > > > > >
> > > > > > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > > > > > >
> > > > > > > > Which version of Struts?
> > > > > > > >
> > > > > > > > --- aum strut <aum.struts@(protected):
> > > > > > > >
> > > > > > > > > Hi all,
> > > > > > > > >
> > > > > > > > > a little point which i want to know.
> > > > > > > > > i have a form by which we can add billing detais in the
> > > > database
> > > > > > > > >
> > > > > > > > > form is working fine, it is adding the value to the
> > database as
> > > > > > > > expected,
> > > > > > > > > the problem whcih i am facing is even after successfully
> > > > submitting
> > > > > > the
> > > > > > > > > values, it is not clearing the form values which has been
> > added
> > > > > > > > >
> > > > > > > > > i can clear the fields values using java script,but i
> > want to
> > > > know
> > > > > > is
> > > > > > > > it
> > > > > > > > > possible using Struts2,is theer any was that when ever
> > data is
> > > > > > > submitted
> > > > > > > > > successfully in the database form fields values should get
> > > > cleared.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > any help in this regard will be much appriciated.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > thanks in advance
> > > > > > > > > --aum
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > ---------------------------------------------------------------------
> > > > > > > > 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)
> > > > > >
> > > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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_185649.ezm (zipped)Nils can u just describe a bit wat u mean here by redirect
its quite possible that i am taking redirect in some other way..
aum
On 4/21/08, Nils-Helge Garli Hegvik <nilsga@(protected):
>
> I don't see why that should prevent you from doing a redirect?
>
> Nils-H
>
> On Mon, Apr 21, 2008 at 5:44 AM, aum strut <aum.struts@(protected):
> > Nils
> >
> > though i have achieved this using javascript
> > my problem was that i can not redirect as i have to enter multipal
> records
> > at a given time
> >
> >
> >
> >
> > On 4/20/08, Nils-Helge Garli Hegvik <nilsga@(protected):
> > >
> > > Considering you're processing the form and displaying the form using
> > > the same action within the same request, I would say this is expected
> > > behavior. I would consider doing a redirect after the post instead.
> > >
> > > Nils-H
> > >
> > > On Sat, Apr 19, 2008 at 12:06 PM, aum strut <aum.struts@(protected)>
> wrote:
> > > > i am not using Spring at all.here is the code for my configuration
> and
> > > > action class
> > > >
> > > > my *Quotation.jsp page* by which i am adding data
> > > >
> > > >
> > > > <%@(protected)" %>
> > > >
> > > > <html>
> > > >
> > > > <head>
> > > >
> > > > <title>Quotation Form</title>
> > > >
> > > > <s:head theme="ajax"/>
> > > >
> > > > </head>
> > > >
> > > > <body>
> > > >
> > > > <center><font face="verdana" size="2"
> color="red"><s:actionmessage></
> > > > s:actionmessage></font></center>
> > > >
> > > > <h1 align="center"> Quotation Form</h1>
> > > >
> > > > <s:form action="SaveBill">
> > > >
> > > > <table align="center">
> > > >
> > > > <s:datetimepicker label="Date:" name="date"/></td><td>
> > > >
> > > > <s:textfield label="Voucher Number:" name="voucherNumber"/>
> > > >
> > > > <s:textfield label="Customer Name:" name="customerName"/>
> > > >
> > > > <s:textarea label="Address" name="address" cols="20" rows="4"/>
> > > >
> > > > <s:textfield label="Contact No:" name="contactNo"/>
> > > >
> > > > <s:textfield label="Item Name:" name="itemName"/>
> > > >
> > > > <s:textfield label="Purity:" name="purity"/>
> > > >
> > > > <s:textfield label="Gross Weight(Gms):" name="grossWeight"/>
> > > >
> > > > <s:textfield label="Net Weight(Gms):" name="netWeight"/>
> > > >
> > > > <s:textfield label="Diamond Weight:" name="diamondWeight"/>
> > > >
> > > > <s:textfield label="Gold Rate(Rs):" name="goldRate"/>
> > > >
> > > > <s:textfield label="Amount:" name="amount"/>
> > > >
> > > > <s:submit label="Save" align="center" />
> > > >
> > > > </table>
> > > >
> > > > </s:form>
> > > >
> > > > </body>
> > > >
> > > > </html>
> > > > *my action class*
> > > >
> > > >
> > > > package raisonne.billgeneration;
> > > >
> > > > import
com.opensymphony.xwork2.ActionSupport;
> > > > import raisonne.billgeneration.GetBillConnection;
> > > >
> > > > public class SaveBillingData extends ActionSupport{
> > > >
> > > > /**
> > > > *
> > > > */
> > > > private static final long serialVersionUID =
> -5856152810070496725L;
> > > > private int rowInserted=0;
> > > > private String date=null;
> > > > private String voucherNumber=null;
> > > > private String customerName=null;
> > > > private String address=null;
> > > > private String contactNo=null;
> > > > private String itemName=null;
> > > > private String purity=null;
> > > > private double grossWeight=0.0;
> > > > private double netWeight=0.0;
> > > > private double diamondWeight=0.0;
> > > > private double goldRate=0.0;
> > > > private double amount=0.0;
> > > >
> > > > /*
> > > >
> > > > Getter and Setter Method
> > > >
> > > > */
> > > >
> > > > public String execute() throws Exception{
> > > > GetBillConnection billCollection =new GetBillConnection();
> > > >
> > >
> rowInserted=billCollection.AddBillingData(getDate(),getVoucherNumber(),
> > > > getCustomerName(),getAddress(),getContactNo(),
> > > > getItemName(),getPurity(),getGrossWeight(),
> > > > getNetWeight(),getDiamondWeight(),getGoldRate(),getAmount());
> > > > if(rowInserted>0){
> > > > addActionMessage("Quotation data has been submitted
> successfully");
> > > > return SUCCESS;
> > > > }
> > > > else{
> > > > addActionMessage("Error while saving Quotation data, Pleaes
> retry");
> > > > return INPUT;
> > > > }
> > > > }
> > > >
> > > >
> > > > }
> > > >
> > > >
> > > > lastly *Struts.xml file*
> > > >
> > > >
> > > > <package name="raisonne.billgeneration" extends="struts-default"
> > > namespace=
> > > > "/">
> > > >
> > > > <action name="SaveBill"
> > > class="raisonne.billgeneration.SaveBillingData">
> > > >
> > > > <result name="success">/BillGeneration/Quotation.jsp</result>
> > > >
> > > > <result name="input">/Login/Login.jsp</result>
> > > >
> > > > </action>
> > > >
> > > > </package>
> > > > -aum
> > > >
> > > >
> > > >
> > > >
> > > > On 4/19/08, Nils-Helge Garli Hegvik <nilsga@(protected):
> > > > >
> > > > > It would be a lot easier helping if you show us some
> configuration
> > > > > files and code....
> > > > >
> > > > > Nils-H
> > > > >
> > > > > On Sat, Apr 19, 2008 at 6:59 AM, aum strut <aum.struts@(protected)
> >
> > > wrote:
> > > > > > yes you are right
> > > > > >
> > > > > > not providing complete information in one mail is really not
> good
> > > > > >
> > > > > > i wil take this in to account in future...
> > > > > >
> > > > > > well i am not using spring in my application i have a simple
> form
> > > which
> > > > > is
> > > > > > sending the input values to my action where i am adding these
> in
> > > to the
> > > > > data
> > > > > > base using simple jdbc call everything is working fine i am
> even
> > > > > getting
> > > > > > back the success response in my add form.
> > > > > >
> > > > > > i am not able to understand what u mean by "not have your
> action
> > > > > defined as
> > > > > > being "prototype"
> > > > > > scope"
> > > > > >
> > > > > > aum
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > > > > >
> > > > > > > Are you using Spring?
> > > > > > >
> > > > > > > Would it be possible for you to provide more useful
> information
> > > in
> > > > > your
> > > > > > > initial emails rather than generating a stream of a
> half-dozen
> > > or
> > > > > more?
> > > > > > > It's
> > > > > > > rather frustrating; we've gone through this before.
> > > > > > >
> > > > > > > One common error is to not have your action defined as
> being
> > > > > "prototype"
> > > > > > > scope. Since actions are instantiated on each request
> (normally)
> > > it's
> > > > > not
> > > > > > > typical to see this behavior without some effort on your
> part or
> > > > > > > mis-configuration.
> > > > > > >
> > > > > > > Dave
> > > > > > >
> > > > > > > --- aum strut <aum.struts@(protected):
> > > > > > >
> > > > > > > > currently i am using struts-2.0.11.1
> > > > > > > >
> > > > > > > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > > > > > > >
> > > > > > > > > Which version of Struts?
> > > > > > > > >
> > > > > > > > > --- aum strut <aum.struts@(protected):
> > > > > > > > >
> > > > > > > > > > Hi all,
> > > > > > > > > >
> > > > > > > > > > a little point which i want to know.
> > > > > > > > > > i have a form by which we can add billing detais in
> the
> > > > > database
> > > > > > > > > >
> > > > > > > > > > form is working fine, it is adding the value to the
> > > database as
> > > > > > > > > expected,
> > > > > > > > > > the problem whcih i am facing is even after
> successfully
> > > > > submitting
> > > > > > > the
> > > > > > > > > > values, it is not clearing the form values which has
> been
> > > added
> > > > > > > > > >
> > > > > > > > > > i can clear the fields values using java script,but
> i
> > > want to
> > > > > know
> > > > > > > is
> > > > > > > > > it
> > > > > > > > > > possible using Struts2,is theer any was that when
> ever
> > > data is
> > > > > > > > submitted
> > > > > > > > > > successfully in the database form fields values
> should get
> > > > > cleared.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > any help in this regard will be much appriciated.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > thanks in advance
> > > > > > > > > > --aum
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > > > > > 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)
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > 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)
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185652.ezm (zipped)By "redirect" I mean using the redirect action result type.
Nils-H
On Mon, Apr 21, 2008 at 6:40 AM, aum strut <aum.struts@(protected):
> Nils can u just describe a bit wat u mean here by redirect
> its quite possible that i am taking redirect in some other way..
>
> aum
>
>
>
>
> On 4/21/08, Nils-Helge Garli Hegvik <nilsga@(protected):
> >
> > I don't see why that should prevent you from doing a redirect?
> >
> > Nils-H
> >
> > On Mon, Apr 21, 2008 at 5:44 AM, aum strut <aum.struts@(protected):
> > > Nils
> > >
> > > though i have achieved this using javascript
> > > my problem was that i can not redirect as i have to enter multipal
> > records
> > > at a given time
> > >
> > >
> > >
> > >
> > > On 4/20/08, Nils-Helge Garli Hegvik <nilsga@(protected):
> > > >
> > > > Considering you're processing the form and displaying the form using
> > > > the same action within the same request, I would say this is expected
> > > > behavior. I would consider doing a redirect after the post instead.
> > > >
> > > > Nils-H
> > > >
> > > > On Sat, Apr 19, 2008 at 12:06 PM, aum strut <aum.struts@(protected)>
> > wrote:
> > > > > i am not using Spring at all.here is the code for my configuration
> > and
> > > > > action class
> > > > >
> > > > > my *Quotation.jsp page* by which i am adding data
> > > > >
> > > > >
> > > > > <%@(protected)" %>
> > > > >
> > > > > <html>
> > > > >
> > > > > <head>
> > > > >
> > > > > <title>Quotation Form</title>
> > > > >
> > > > > <s:head theme="ajax"/>
> > > > >
> > > > > </head>
> > > > >
> > > > > <body>
> > > > >
> > > > > <center><font face="verdana" size="2"
> > color="red"><s:actionmessage></
> > > > > s:actionmessage></font></center>
> > > > >
> > > > > <h1 align="center"> Quotation Form</h1>
> > > > >
> > > > > <s:form action="SaveBill">
> > > > >
> > > > > <table align="center">
> > > > >
> > > > > <s:datetimepicker label="Date:" name="date"/></td><td>
> > > > >
> > > > > <s:textfield label="Voucher Number:" name="voucherNumber"/>
> > > > >
> > > > > <s:textfield label="Customer Name:" name="customerName"/>
> > > > >
> > > > > <s:textarea label="Address" name="address" cols="20" rows="4"/>
> > > > >
> > > > > <s:textfield label="Contact No:" name="contactNo"/>
> > > > >
> > > > > <s:textfield label="Item Name:" name="itemName"/>
> > > > >
> > > > > <s:textfield label="Purity:" name="purity"/>
> > > > >
> > > > > <s:textfield label="Gross Weight(Gms):" name="grossWeight"/>
> > > > >
> > > > > <s:textfield label="Net Weight(Gms):" name="netWeight"/>
> > > > >
> > > > > <s:textfield label="Diamond Weight:" name="diamondWeight"/>
> > > > >
> > > > > <s:textfield label="Gold Rate(Rs):" name="goldRate"/>
> > > > >
> > > > > <s:textfield label="Amount:" name="amount"/>
> > > > >
> > > > > <s:submit label="Save" align="center" />
> > > > >
> > > > > </table>
> > > > >
> > > > > </s:form>
> > > > >
> > > > > </body>
> > > > >
> > > > > </html>
> > > > > *my action class*
> > > > >
> > > > >
> > > > > package raisonne.billgeneration;
> > > > >
> > > > > import
com.opensymphony.xwork2.ActionSupport;
> > > > > import raisonne.billgeneration.GetBillConnection;
> > > > >
> > > > > public class SaveBillingData extends ActionSupport{
> > > > >
> > > > > /**
> > > > > *
> > > > > */
> > > > > private static final long serialVersionUID =
> > -5856152810070496725L;
> > > > > private int rowInserted=0;
> > > > > private String date=null;
> > > > > private String voucherNumber=null;
> > > > > private String customerName=null;
> > > > > private String address=null;
> > > > > private String contactNo=null;
> > > > > private String itemName=null;
> > > > > private String purity=null;
> > > > > private double grossWeight=0.0;
> > > > > private double netWeight=0.0;
> > > > > private double diamondWeight=0.0;
> > > > > private double goldRate=0.0;
> > > > > private double amount=0.0;
> > > > >
> > > > > /*
> > > > >
> > > > > Getter and Setter Method
> > > > >
> > > > > */
> > > > >
> > > > > public String execute() throws Exception{
> > > > > GetBillConnection billCollection =new GetBillConnection();
> > > > >
> > > >
> > rowInserted=billCollection.AddBillingData(getDate(),getVoucherNumber(),
> > > > > getCustomerName(),getAddress(),getContactNo(),
> > > > > getItemName(),getPurity(),getGrossWeight(),
> > > > > getNetWeight(),getDiamondWeight(),getGoldRate(),getAmount());
> > > > > if(rowInserted>0){
> > > > > addActionMessage("Quotation data has been submitted
> > successfully");
> > > > > return SUCCESS;
> > > > > }
> > > > > else{
> > > > > addActionMessage("Error while saving Quotation data, Pleaes
> > retry");
> > > > > return INPUT;
> > > > > }
> > > > > }
> > > > >
> > > > >
> > > > > }
> > > > >
> > > > >
> > > > > lastly *Struts.xml file*
> > > > >
> > > > >
> > > > > <package name="raisonne.billgeneration" extends="struts-default"
> > > > namespace=
> > > > > "/">
> > > > >
> > > > > <action name="SaveBill"
> > > > class="raisonne.billgeneration.SaveBillingData">
> > > > >
> > > > > <result name="success">/BillGeneration/Quotation.jsp</result>
> > > > >
> > > > > <result name="input">/Login/Login.jsp</result>
> > > > >
> > > > > </action>
> > > > >
> > > > > </package>
> > > > > -aum
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 4/19/08, Nils-Helge Garli Hegvik <nilsga@(protected):
> > > > > >
> > > > > > It would be a lot easier helping if you show us some
> > configuration
> > > > > > files and code....
> > > > > >
> > > > > > Nils-H
> > > > > >
> > > > > > On Sat, Apr 19, 2008 at 6:59 AM, aum strut <aum.struts@(protected)
> > >
> > > > wrote:
> > > > > > > yes you are right
> > > > > > >
> > > > > > > not providing complete information in one mail is really not
> > good
> > > > > > >
> > > > > > > i wil take this in to account in future...
> > > > > > >
> > > > > > > well i am not using spring in my application i have a simple
> > form
> > > > which
> > > > > > is
> > > > > > > sending the input values to my action where i am adding these
> > in
> > > > to the
> > > > > > data
> > > > > > > base using simple jdbc call everything is working fine i am
> > even
> > > > > > getting
> > > > > > > back the success response in my add form.
> > > > > > >
> > > > > > > i am not able to understand what u mean by "not have your
> > action
> > > > > > defined as
> > > > > > > being "prototype"
> > > > > > > scope"
> > > > > > >
> > > > > > > aum
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > > > > > >
> > > > > > > > Are you using Spring?
> > > > > > > >
> > > > > > > > Would it be possible for you to provide more useful
> > information
> > > > in
> > > > > > your
> > > > > > > > initial emails rather than generating a stream of a
> > half-dozen
> > > > or
> > > > > > more?
> > > > > > > > It's
> > > > > > > > rather frustrating; we've gone through this before.
> > > > > > > >
> > > > > > > > One common error is to not have your action defined as
> > being
> > > > > > "prototype"
> > > > > > > > scope. Since actions are instantiated on each request
> > (normally)
> > > > it's
> > > > > > not
> > > > > > > > typical to see this behavior without some effort on your
> > part or
> > > > > > > > mis-configuration.
> > > > > > > >
> > > > > > > > Dave
> > > > > > > >
> > > > > > > > --- aum strut <aum.struts@(protected):
> > > > > > > >
> > > > > > > > > currently i am using struts-2.0.11.1
> > > > > > > > >
> > > > > > > > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > > > > > > > >
> > > > > > > > > > Which version of Struts?
> > > > > > > > > >
> > > > > > > > > > --- aum strut <aum.struts@(protected):
> > > > > > > > > >
> > > > > > > > > > > Hi all,
> > > > > > > > > > >
> > > > > > > > > > > a little point which i want to know.
> > > > > > > > > > > i have a form by which we can add billing detais in
> > the
> > > > > > database
> > > > > > > > > > >
> > > > > > > > > > > form is working fine, it is adding the value to the
> > > > database as
> > > > > > > > > > expected,
> > > > > > > > > > > the problem whcih i am facing is even after
> > successfully
> > > > > > submitting
> > > > > > > > the
> > > > > > > > > > > values, it is not clearing the form values which has
> > been
> > > > added
> > > > > > > > > > >
> > > > > > > > > > > i can clear the fields values using java script,but
> > i
> > > > want to
> > > > > > know
> > > > > > > > is
> > > > > > > > > > it
> > > > > > > > > > > possible using Struts2,is theer any was that when
> > ever
> > > > data is
> > > > > > > > > submitted
> > > > > > > > > > > successfully in the database form fields values
> > should get
> > > > > > cleared.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > any help in this regard will be much appriciated.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > thanks in advance
> > > > > > > > > > > --aum
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > > > > > 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)
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > 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)
> > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>

Attachment:
user_185651.ezm (zipped)Thanks I will have a look, Lot of grids got the
limitation to have combo boxes in the Grid,
If any such Grid someone knows that will be great, we
are looking for a such a grid with Sorting and
Pagination features.
Has anyone enhanced the ftl to share with us.
Thanks
--- Jeromy Evans <jeromy.evans@(protected)>
wrote:
> tom tom wrote:
> > Hi,
> >
> > What exactly the benefits of moving from struts
> 2.0.6
> > to
> > 2.0.11.
> >
> >
> Mainly important bugfixes and security fixes. There
> are few new features.
> 2.0.x -> 2.1 provides better ajax tags and new
> plugins.
> > As far as the Ajax support is concerned, we do
> have a
> > requirement to have a editable grid,
> >
> > Is this facilitated within struts 2?
> >
> There is no tag bundled in struts 2 but Struts2 can
> serve data to
> editable grids provided by any client-side library.
> > What is the best way to achieve it.
> >
> Review the available editable datagrid options (eg.
> yui, ext, dojo1+),
> examine their table model requirements, create an
> action that serves the
> model (as json, xml or whatever the component
> requires).
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)
>
>
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Attachment:
user_185653.ezm (zipped)I use YUI.
Have a look at Satyam's demo of the editable datagrid to see if it's
suitable:
http://www.satyam.com.ar/yui/DataGrid.html
It supports client-side and server-side pagination and sorting:
http://developer.yahoo.com/yui/datatable/
tom tom wrote:
> Thanks I will have a look, Lot of grids got the
> limitation to have combo boxes in the Grid,
>
> If any such Grid someone knows that will be great, we
> are looking for a such a grid with Sorting and
> Pagination features.
>
> Has anyone enhanced the ftl to share with us.
>
> Thanks
>
>
> --- Jeromy Evans <jeromy.evans@(protected)>
> wrote:
>
>
>> tom tom wrote:
>>
>>> Hi,
>>>
>>> What exactly the benefits of moving from struts
>>>
>> 2.0.6
>>
>>> to
>>> 2.0.11.
>>>
>>>
>>>
>> Mainly important bugfixes and security fixes. There
>> are few new features.
>> 2.0.x -> 2.1 provides better ajax tags and new
>> plugins.
>>
>>> As far as the Ajax support is concerned, we do
>>>
>> have a
>>
>>> requirement to have a editable grid,
>>>
>>> Is this facilitated within struts 2?
>>>
>>>
>> There is no tag bundled in struts 2 but Struts2 can
>> serve data to
>> editable grids provided by any client-side library.
>>
>>> What is the best way to achieve it.
>>>
>>>
>> Review the available editable datagrid options (eg.
>> yui, ext, dojo1+),
>> examine their table model requirements, create an
>> action that serves the
>> model (as json, xml or whatever the component
>> requires).
>>
>>
>>
>>
> ---------------------------------------------------------------------
>
>> To unsubscribe, e-mail:
>> user-unsubscribe@(protected)
>> For additional commands, e-mail:
>> user-help@(protected)
>>
>>
>>
>
>
>
> ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
>

Attachment:
user_185655.ezm (zipped)Hi Stan,
mostly it's just a little mistake, that makes you crazy ....
Did you make sure that the key in the properties_en-file is existent and properly written (error.login.failed) ?
I am using the same mechanism an it works without any trouble. Can only be a stupid mistake.
If you are using eclipse, try to find out if your java-classes are compiled. (Just delete the .class file and compile).
Had that problem yesterday. (Just an idea ;) )
Hi Volker,
my Action class implements ServletRequestAware. When I check the locale with
request.getParameter("request_locale"), I get 'en' as result.
The both *.properties files are in the same classpath.
If the logon is invalid I put the actionError and return LOGIN
and go back to Logon.jsp.
My action definition:
<action name="doLogon" class="com.imp.app.usr.Logon">
<result name="input">/Logon.jsp</result>
<result name="error">/Logon.jsp</result>
<result name="login">/Logon.jsp</result>
<result name="success" type="redirect-action">
Welcome
</result>
</action>
After the action, the Logon.jsp is displayed with all contents in english
excepting the action Error and the hole login form,
including labels, buttons etc. wich seems to get his content from
package.properties.
All menu items, another form and anything else is displayed from the
package_en.properties.
I don't why, because both files are at the same position.
Volker Karlmeier wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> you should try to find out, what the acutal locale is and if there
> is a suitable properties-file.
> Next, try to find out, if your properties-file is found in the
> right position. (Package etc.) and if it
> is accessible.
> Maybe you have not extended RequestAware in your class.....
>
>
> Volker
>
> stan77 schrieb:
>> Hello,
>>
>> I'm new to struts 2.
>> I have the following problem with internationalization in my Action
> classes.
>>
>> there are two properties files package.properties and
>> package_en.properties
>> wich works correctly in most cases.
>>
>> In my Logon action i would like to add an Action error like this:
>>
>> addActionError(getText("error.login.failed"));
>>
>> The message is dispayed in my jsp, but always get it's string from
>> package.properties,
>> never from package_en.properties. Seems, that the request_locale is not
>> reachable in my
>> Action class.
>> I've searched a several days for a solution, but can't find anything.
>>
>> Thanks for help.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFICzpUx4KjH6Tk4MMRApIbAKC4pKdtpGstmMYb5F7mr/SU2AdHqgCfRtQR
> UKbnP14prumG73NvVAQBy7w=
> =2ETC
> -----END PGP SIGNATURE-----
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
http://www.nabble.com/Problem-with-internationalization-in-addActionError-tp1679
0683p16797626.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)