Does this FAQ entry help?
http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.a
ct: Re: Form values getting empty After validation failure
> From: pundari...@gmail.com
> To: user@struts.apache.org
>
> Hi Adam,
>
> You are right. The problem is fixed now. However I am facing a different
> issue now. I also have a couple of html select controls in the page. Fo
ction it should
> retrieve the value and re-display them
>
> i have a similar thing and it works fine.
>
>
>
>
> > Date: Wed, 24 Mar 2010 11:45:49 +0530
> > Subject: Form values getting empty After validation failure
> > Fro
works fine.
> Date: Wed, 24 Mar 2010 11:45:49 +0530
> Subject: Form values getting empty After validation failure
> From: pundari...@gmail.com
> To: user@struts.apache.org
>
> Hi,
>
> I am using html file control to upload a file
Hi,
don't know if it will be usefull, but some days ago someone in the user
list suggested using the getters and setters of the properties that map
to your form to call get() and put() methods of the current session (
ActionContext.getContext().getSession() ) , so you get "automatic"
session
Hi,
I am using html file control to upload a file. If file size exceeds a limit,
then I return an error from Action class through ActionMessages object. The
errors are displayed fine.The problem is that the input form has around 10
fields and after I return control to it for file size limit error
Struts 1.3.10
Is it possible to repopulate a List of Objects on an ActionForm upon
validation failure? If so, how?
Here's a simple example of what I'm trying:
*JSP:*
*Form:*
String year;
List yearList = new ArrayList();
public String getYear() {
return year;
}
public vo
You should tell us how the dropdowns were populated in the first page.
If only one Action class is involved, and the dropdowns are populated
by reading some attribute of it
(eg: getOptionListForDropDown() which looks at the
optionListForDropDown list )
you should fill that list, not in the action
Implement Preparable interface [1] and take a look on Prepare
interceptor [2], it should be what you want
[1]
http://struts.apache.org/2.1.6/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html
[2] http://struts.apache.org/2.1.6/docs/prepare-interceptor.html
Regards
--
Lukasz
http://ww
validation fails, so if you have things that
you want to make sure occur on validation failure, put them there.
jk
On Mon, Mar 2, 2009 at 1:30 PM, Sundararaman, Anand <
anand.sundarara...@ps.net> wrote:
> Hi,
> Would you able to specify in little more detail? Sorry for that as I
Hi,
Would you able to specify in little more detail? Sorry for that as I am new
to Struts 2.
Thanks,
Anand
-Original Message-
From: Jim Kiley [mailto:jhki...@summa-tech.com]
Sent: Monday, March 02, 2009 12:23 PM
To: Struts Users Mailing List
Subject: Re: Struts 2 - After validation
Populating the dropdowns in an input() method that returns Action.INPUT
should do the trick.
jk
On Mon, Mar 2, 2009 at 1:19 PM, Sundararaman, Anand <
anand.sundarara...@ps.net> wrote:
> Hi,
> I guess there is an elegant solution for this but I could not find out in
> the user list.
>
> I am usin
Hi,
I guess there is an elegant solution for this but I could not find out in the
user list.
I am using Struts 2 and creating some form validations. If a validation fails
on a JSP screen, the input result takes back the control to the same screen,
but the drop downs are not populated. I nee
iling List
Subject: Re: file upload file location lost on validation failure
Derrick Koes wrote:
> There is a value attribute on the file tag from which you can preset
the
> value according to docs.
>
> http://struts.apache.org/2.0.14/docs/file.html
>
> It seems like the value
Derrick Koes wrote:
There is a value attribute on the file tag from which you can preset the
value according to docs.
http://struts.apache.org/2.0.14/docs/file.html
It seems like the value could be "updated" from the user input, if the
input data is available.
File input values cannot be prel
ave Newton [mailto:newton.d...@yahoo.com]
Sent: Tuesday, January 06, 2009 12:29 PM
To: Struts Users Mailing List
Subject: Re: file upload file location lost on validation failure
Derrick Koes wrote:
> Understood. However, if the value used to populate the field is on
the
> value stack, t
Derrick Koes wrote:
Understood. However, if the value used to populate the field is on the
value stack, the input will be populated with the value on validation
failure, except in this case it seems as the data necessary to
repopulate is not available.
I think we're talking past each
Understood. However, if the value used to populate the field is on the
value stack, the input will be populated with the value on validation
failure, except in this case it seems as the data necessary to
repopulate is not available.
Derrick
-Original Message-
From: Dave Newton
Derrick Koes wrote:
Using the demo app (struts2-showcase-2.0.14/fileupload) and entering an
empty file, for example, will correctly cause validation to fail.
However, the file location disappears from the input.
Is this as designed?
Do you mean in the file input field? If so, that's normal bro
Using the demo app (struts2-showcase-2.0.14/fileupload) and entering an
empty file, for example, will correctly cause validation to fail.
However, the file location disappears from the input.
Is this as designed?
Thanks,
Derrick
sage in context:
http://www.nabble.com/ModelDriven-CRUD-validation-failure-still-causes-JPA-update-tp12987242p21062748.html
Sent from the Struts - User mailing list archive at Nabble.com.
-
To unsubscribe, e-mail: user-unsubscr...
Hi,
I need to implement an use case where the data needs to be saved in DB, even
though all the submitted form fields aren't valid. The rule is to make those
fields empty and insert whatever is good into the DB (there are few
non-nillable fields that need to be valid as a prerequisite). I don't wa
ervices
>> ECOS Development Team
>> [EMAIL PROTECTED]
>> 970-226-9290
>>
>> Fort Collins Science Center
>> US Geological Survey
>> 2150 Centre Ave, Building C
>> Fort Collins, CO 80526-8116
>>
>>
>>
>> "Al Sutt
n java source
>
> M-
> - Original Message -
> From: "jwpronto" <[EMAIL PROTECTED]>
> To:
> Sent: Saturday, January 26, 2008 6:41 PM
> Subject: s:action with validation failure of form submit
>
>
>>
>> Hi All -
>>
>> I have
please post:
jsp
xwork.xml entries for actionTag
Action java source
M-
- Original Message -
From: "jwpronto" <[EMAIL PROTECTED]>
To:
Sent: Saturday, January 26, 2008 6:41 PM
Subject: s:action with validation failure of form submit
>
> Hi All -
>
> I have a
Hi All -
I have an s:action tag embedded in a JSP. The s:action populates a List in
the request which a select box uses to populate.
When there is a validation failure the s:action tag is not being called.
The interesting thing is that I have this exact setup on a previous page
(this is a 3
ly using transactions?
>
> If so why not modify the interceptor to only commit if a SUCCESS is
> returned
> or perform a rollback if ERROR is returned from the action invocation.
>
> Al.
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
9290
>
> Fort Collins Science Center
> US Geological Survey
> 2150 Centre Ave, Building C
> Fort Collins, CO 80526-8116
>
>
>
> "Al Sutton" <[EMAIL PROTECTED]>
> 10/02/2007 12:14 AM
> Please respond to
> "Struts Users Mailing List"
>
uot;Struts Users Mailing List"
To
"'Struts Users Mailing List'"
cc
Subject
RE: ModelDriven CRUD validation failure still causes JPA update - RESOLVED
Just a thought, are you actually using transactions?
If so why not modify the interceptor to only commit if a SU
October 2007 04:04
To: Struts Users Mailing List
Subject: Re: ModelDriven CRUD validation failure still causes JPA update -
RESOLVED
OK: I've fixed the problem.
I'm not sure why this was the case, but here is what was causing the
problem:
In my ModelDriven action, I had a method
e Ave, Building C
Fort Collins, CO 80526-8116
[EMAIL PROTECTED]
10/01/2007 08:29 PM
Please respond to
"Struts Users Mailing List"
To
"Struts Users Mailing List"
cc
Subject
Re: ModelDriven CRUD validation failure still causes JPA update
Unfortunately, it app
ase respond to
"Struts Users Mailing List"
To
"Struts Users Mailing List"
cc
Subject
Re: ModelDriven CRUD validation failure still causes JPA update
Only difference is that I don't use model driven. Is there any setting
to tell hibernate to flush the session when c
rs Mailing List
cc
Subject
Re: ModelDriven CRUD validation failure still causes JPA update
--- [EMAIL PROTECTED] wrote:
> That's an interesting idea Dave. I'm using the
> paramsPrepareStack. It'll take some investigation to
> see if that would fix the issue.
Shouldn
ASRC Management Services
> ECOS Development Team
> [EMAIL PROTECTED]
> 970-226-9290
>
> Fort Collins Science Center
> US Geological Survey
> 2150 Centre Ave, Building C
> Fort Collins, CO 80526-8116
>
>
>
> "Musachy Barroso" <[EMAIL PROTECTED]>
IL PROTECTED]>
10/01/2007 05:10 PM
Please respond to
"Struts Users Mailing List"
To
"Struts Users Mailing List"
cc
Subject
Re: ModelDriven CRUD validation failure still causes JPA update
I only use the beanutils.copy solution on a few places, on the other
cases I a
don't have to do this copy but can rather cut out the old Struts 1
ActionForm "middle-man" bean and do direct updates to your business
objects. Everything works great except this one problem with a validation
failure inappropriately triggering a database update.
* manage
I only use the beanutils.copy solution on a few places, on the other
cases I always load the object model on the prepare() method if the
"id" field is set (editing), and then call update or create on the
entity manager in my action method. I never got that problem so I'm
wondering what is different
--- [EMAIL PROTECTED] wrote:
> That's an interesting idea Dave. I'm using the
> paramsPrepareStack. It'll take some investigation to
> see if that would fix the issue.
Shouldn't take much; it might be as simple as adding a
validate/defaultWorkFlow up towards the top (although
I might try just add
cal Survey
2150 Centre Ave, Building C
Fort Collins, CO 80526-8116
Dave Newton <[EMAIL PROTECTED]>
10/01/2007 03:32 PM
Please respond to
"Struts Users Mailing List"
To
Struts Users Mailing List
cc
Subject
Re: ModelDriven CRUD validation failure still causes JPA update
I
> * instantiate a temporary bean used for the form only:
> BeanUtils.copyProperties(tempBean, yourBean);
>
That's what I do.
musachy
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
-
To unsubscribe, e-mail: [EMAI
> Since my Model is acquired from the Hibernate session (during the
> "prepare()" Action method), it is a transactional persistent instance.
> Note this from the hibernate documentation:
>
> "Transactional persistent instances (ie. objects loaded, saved, created or
> queried by the Session) may be
CO 80526-8116
>
>
>
> "Musachy Barroso" <[EMAIL PROTECTED]>
> 10/01/2007 02:42 PM
> Please respond to
> "Struts Users Mailing List"
>
>
> To
> "Struts Users Mailing List"
> cc
>
> Subject
> Re: ModelDrive
:42 PM
Please respond to
"Struts Users Mailing List"
To
"Struts Users Mailing List"
cc
Subject
Re: ModelDriven CRUD validation failure still causes JPA update
If there is a validation error the code on your action shouldn't be
executed at all, so you wouldn't hav
If there is a validation error the code on your action shouldn't be
executed at all, so you wouldn't have this problem. Are you applying
the "defaultWorkflow" interceptor to your action?
regards
musachy
On 10/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I have a ModelDriven action which c
I have a ModelDriven action which controls CRUD operations on JPA managed
Entity E. E has a property called ?name? which maps to a database column
with a NOT NULL constraint. I have added a RequiredStringValidator
annotation to my Action to validate that the ?model.name? property is
non-null. T
displaying the message in jsp != it can read in the Validator
I also encountered this problem before.
Cliff
--- In [EMAIL PROTECTED], "elisegev1" <[EMAIL PROTECTED]> wrote:
>
> I am learning how to use Struts and have encountered the following
> problem. I have a form bean defined as 'DynaAc
I am learning how to use Struts and have encountered the following
problem. I have a form bean defined as 'DynaActionForm' with
properties defined in struts-config.xml. In validation.xml I specify
the validation rules for some of the properties - not all. The source
code for the generated pa
47 matches
Mail list logo