Thanks!
El vie 16 may 2014 11:48:35 CEST, Lukasz Lenart escribió:
Number 2 is also my favorite but it quite often depends ... on dev's
preferences :D
I remember that I wanted solve that case with ParametersInterceptors
but there was a problem when and how to instantiate Model .
2014-05-08 9:27
Number 2 is also my favorite but it quite often depends ... on dev's
preferences :D
I remember that I wanted solve that case with ParametersInterceptors
but there was a problem when and how to instantiate Model .
2014-05-08 9:27 GMT+02:00 Antonio Sánchez :
> Hello.
>
> I have found problems using
My solution looks like this:
public Foo getModel() {
foo = (Foo) session.get("Foo");
if (foo == null) {
foo = new Foo();
session.put("Foo", foo);
}
return (foo);
}
Then,
o my business logic with my model, then I
> should be ok?
>
>> -Original Message-
>> From: Burton Rhodes [mailto:burtonrho...@gmail.com]
>> Sent: Thursday, March 10, 2011 7:49 PM
>> To: Struts Users Mailing List
>> Subject: Re: RE: Re : Re : ModelDriven & Hi
execute() method to my business logic with my model, then I
should be ok?
> -Original Message-
> From: Burton Rhodes [mailto:burtonrho...@gmail.com]
> Sent: Thursday, March 10, 2011 7:49 PM
> To: Struts Users Mailing List
> Subject: Re: RE: Re : Re : ModelDriven & Hibern
à l'information seulement et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> Date: Thu, 10 Mar 2011 19:39:56 -0600
>
e which I could easily avoid by not
>> allowing the framework to modify my persistent entity and force me to
>> manage the copy/update of the entity accordingly when applicable.
>>
>>> -Original Message-
>>> From: Dave Newton [mailto:davelnew...@gmail.com]
&
CHRIS
>> Cc: Struts Users Mailing List; Maurizio Cucchiara
>> Subject: Re: RE: Re : Re : ModelDriven & Hibernate Entities
>>
>> On Thu, Mar 10, 2011 at 11:38 AM, CRANFORD, CHRIS wrote:
>> > Yes the plugin is in the app's lib directory.
>>
>>
entity accordingly when applicable.
> -Original Message-
> From: Dave Newton [mailto:davelnew...@gmail.com]
> Sent: Thursday, March 10, 2011 10:40 AM
> To: CRANFORD, CHRIS
> Cc: Struts Users Mailing List; Maurizio Cucchiara
> Subject: Re: RE: Re : Re : ModelDriven &a
Annotating @Transactional on the action didn't help.
> -Original Message-
> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
> Sent: Thursday, March 10, 2011 1:41 AM
> To: Struts Users Mailing List
> Cc: CRANFORD, CHRIS
> Subject: Re: RE: Re : Re :
Oh, learn something new every day :)
> -Original Message-
> From: Dave Newton [mailto:davelnew...@gmail.com]
> Sent: Thursday, March 10, 2011 10:40 AM
> To: CRANFORD, CHRIS
> Cc: Struts Users Mailing List; Maurizio Cucchiara
> Subject: Re: RE: Re : Re : ModelDriven &a
On Thu, Mar 10, 2011 at 11:38 AM, CRANFORD, CHRIS wrote:
> Yes the plugin is in the app's lib directory.
Just FYI, that sets the object factory to "spring", so Spring is
instantiating your actions.
(At least it used to.)
Dave
-
Dave -
Yes the plugin is in the app's lib directory.
> -Original Message-
> From: Dave Newton [mailto:davelnew...@gmail.com]
> Sent: Thursday, March 10, 2011 10:37 AM
> To: Struts Users Mailing List
> Cc: CRANFORD, CHRIS; Maurizio Cucchiara
> Subject: Re: RE
On Thu, Mar 10, 2011 at 11:32 AM, CRANFORD, CHRIS wrote:
> I don't use Spring to instantiate my actions, they're not defined like that.
And you're not using the S2 Spring plugin? (Just for the sake of
completeness; I'm only marginally following this thread.)
Dave
nt: Thursday, March 10, 2011 1:41 AM
> To: Struts Users Mailing List
> Cc: CRANFORD, CHRIS
> Subject: Re: RE: Re : Re : ModelDriven & Hibernate Entities
>
> It's exactly what I meant (you can leave in your service class too).
> The object factory must be spring and your cla
e-
> From: Martin Gainty [mailto:mgai...@hotmail.com]
> Sent: Wednesday, March 09, 2011 9:59 PM
> To: Struts Users Mailing List
> Subject: RE: Re : Re : ModelDriven & Hibernate Entities
>
>
> osiv filter (should) set flushing to never (now manual) to prevent
> accidental wr
i dont use the osiv filter i just make sure the DAO object method returns the
objects initialised correctly (i.e. all lazy collections that are to be
accessed are initialised) for how its going to be used - i might have a DAO
method to return the plain object with no collections initialised an
2011 00:08, CRANFORD, CHRIS wrote:
> In the Struts2 Action rather than my service class?
>
>> -Original Message-
>> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
>> Sent: Wednesday, March 09, 2011 4:20 PM
>> To: Struts Users Mailing List
>> Subj
isée ou la copie de ceci est
interdite. Ce message sert à l'information seulement et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni
In the Struts2 Action rather than my service class?
> -Original Message-
> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
> Sent: Wednesday, March 09, 2011 4:20 PM
> To: Struts Users Mailing List
> Subject: Re: RE: Re : Re : ModelDriven & Hibernate Ent
Dave Newton [mailto:davelnew...@gmail.com]
>> Sent: Wednesday, March 09, 2011 2:16 PM
>> To: Struts Users Mailing List
>> Subject: Re: Re : Re : ModelDriven & Hibernate Entities
>>
>> Another reason OSiV filters can be tricky.
>>
>> Dave
>
I still think this is related to my @Transactional annotation maybe.
> -Original Message-
> From: Dave Newton [mailto:davelnew...@gmail.com]
> Sent: Wednesday, March 09, 2011 2:16 PM
> To: Struts Users Mailing List
> Subject: Re: Re : Re : ModelDriven & Hibernate En
t; I'd prefer that changes aren't committed unless I explicitly call to do so on
> the EntityManager; however I understand Hibernate/JPA's reasons behind why it
> works the way it does.
>
>
>
>> -Original Message-
>> From: François Rouxel [mailto:r
> Sent: Wednesday, March 09, 2011 1:35 PM
> To: Struts Users Mailing List
> Subject: Re: Re : Re : ModelDriven & Hibernate Entities
>
> It might just be an order of interceptors problem. One of your first
> interceptors should be your login check. That should definitely
;s reasons behind
> why it works the way it does.
>
>
>
> > -Original Message-
> > From: François Rouxel [mailto:rouxe...@yahoo.com]
> > Sent: Wednesday, March 09, 2011 12:24 PM
> > To: Struts Users Mailing List
> > Subject: Re : Re : ModelDriven
From: François Rouxel [mailto:rouxe...@yahoo.com]
> Sent: Wednesday, March 09, 2011 12:24 PM
> To: Struts Users Mailing List
> Subject: Re : Re : ModelDriven & Hibernate Entities
>
> Hi Chris,
> first,
> you might have another pb, because struts2 does not change your model
> if
.
fr/
- Message d'origine
De : "CRANFORD, CHRIS"
À : Struts Users Mailing List
Envoyé le : Mer 9 mars 2011, 13h 09min 33s
Objet : RE: Re : ModelDriven & Hibernate Entities
Francois -
While that may work for you, I wouldn't place anyt
On Wed, Mar 9, 2011 at 1:09 PM, CRANFORD, CHRIS wrote:
> I wouldn't place anything Hibernate or persistence related in
> my JSP pages at all. In my mind, this breaks the entire
> reasoning behind MVC and the view simply there to render data
IMO OSiV filters put non-render stuff into the JSP anywa
> -Original Message-
> From: François Rouxel [mailto:rouxe...@yahoo.com]
> Sent: Wednesday, March 09, 2011 11:43 AM
> To: Struts Users Mailing List
> Subject: Re : ModelDriven & Hibernate Entities
>
> same issue
> this how I fixed it : (the main idea is to redir
same issue
this how I fixed it : (the main idea is to redirect to a jsp if an exception
occured, and the jsp rollback)
create an error page error.jsp
<%@page import="com.rdvcentral.util.persistance.HibernateUtil"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib pre
Hi Chris,
are You using paramPrepareParams stack?
It should work with it like You expect it to.
Best greetings,
Paweł Wielgus.
2011/1/24 CRANFORD, CHRIS :
> I recently implemented an action using the ModelDriven interface. Since
> my Domain Object doesn't contain anything beyond properties that
Hi Fabiano,
first of all thank you for your valuable hint. I established an interceptor
CommitAwareInterceptor at the top of the interceptor stack. This interceptor
is tagging the JPA transaction for RollbackOnly in case of
a.) the action is not implementing CommitAware
b.) the action is
call the setModel at the end of your action?
On Tue, Oct 28, 2008 at 4:33 AM, Alexander Baetz
<[EMAIL PROTECTED]>wrote:
> Hi,
>
> inside the execute method of an action i'm retrieving an Object. I want the
> ModelDriven-Interceptor, to put it on the Stack when execute is done.
> One solution woul
Emil.I wrote:
Hello
i have a textfield with the name="firstName"
and a textfield with the name="address.city" etc..
the action is model driven where firstName is the property of model.
Since address is a property of action (not property of model)
how come address.city does not get set it doesn't
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
Dave Newton wrote:
--- Gary Affonso <[EMAIL PROTECTED]> wrote:
And that does it. Direct model injection. Easy.
Technically, no, it's indirected by one level.
*All* ModelDriven does is push the model on to the
stack so it's available at the top level. AFAIK
there's no compelling reason to do
Jon Wilmoth wrote:
Besides the simplified view references, I've used the level of
indirection to allow for a dynamic model on a single action class
that implements a number of related actions. In my case the action
configuration sets a static property that defines the model property.
>
The get
ation uses the action
static parameter to determine which model is being requested.
- Original Message
From: Dave Newton <[EMAIL PROTECTED]>
To: Struts Users Mailing List
Sent: Friday, November 2, 2007 9:33:03 AM
Subject: Re: ModelDriven vs OGNL assignment?
--- Gary Affonso <[E
--- Gary Affonso <[EMAIL PROTECTED]> wrote:
> And that does it. Direct model injection. Easy.
Technically, no, it's indirected by one level.
*All* ModelDriven does is push the model on to the
stack so it's available at the top level. AFAIK
there's no compelling reason to do that other than
savi
well, I am using it in a simple JSP :
If I put the key/value in PersonneFilterAction.properties
(.properties it works, but not in
.properties PersonneFilterBean.properties
[EMAIL PROTECTED]
Ian Roughley wrote:
>
> Model properties files are used for supplyi
Model properties files are used for supplying field description and
validation messages for a model object. I know it works ;-) but I
don't know how you are using it from the code supplied.
/Ian
Dave Newton wrote:
Hmm, in the docs [1] it says that it will search for
"ModelDriven's model", a
Hmm, in the docs [1] it says that it will search for
"ModelDriven's model", although I haven't tried it
myself.
d.
[1]
http://struts.apache.org/2.x/docs/localization.html
--- Zarar Siddiqi <[EMAIL PROTECTED]> wrote:
> I thought you could only specify properties files
> for action beans,
> not m
I thought you could only specify properties files for action beans,
not model ones. So in your case try specifying
PersonneFilterAction.properties
Zarar
On 10/8/07, pilou <[EMAIL PROTECTED]> wrote:
>
> hi
> I noticed that the property bundles named with the Model Bean class name
> does not seem
nt Team
> [EMAIL PROTECTED]
> 970-226-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
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
e Ave, Building C
Fort Collins, CO 80526-8116
Piero Sartini <[EMAIL PROTECTED]>
10/01/2007 03:38 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 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
>
> Yikes, what if getModel() is doing actual work, you're
> calling it twice for no apparent reason. Wouldn't it be
> significantly safer to:
>
> public String intercept(ActionInvocation invocation) throws
> Exception {
> Object action = invocation.getAction();
> if (action instan
--- [EMAIL PROTECTED] wrote:
> So is this 2.0.9 javadoc correct?
It's XWork, not S2; not sure which version.
> /**
> * @return the model to be pushed onto the
> ValueStack instead of the
> Action itself
> */
It also says:
/**
* ModelDriven Actions provide a model object to be
pus
Yes indeed! The more I look at the code in these interceptors, the more I
question the number of times Ctrl-C and Ctrl-V were pressed!
Scott
On 9/21/07, Chris Pratt <[EMAIL PROTECTED]> wrote:
>
> > On 9/21/07, Dave Newton <[EMAIL PROTECTED]> wrote:
> > > public String intercept(ActionInvocation
> On 9/21/07, Dave Newton <[EMAIL PROTECTED]> wrote:
> > public String intercept(ActionInvocation invocation)
> > throws Exception {
> > Object action = invocation.getAction();
> > if (action instanceof ModelDriven) {
> > ModelDriven modelDriven = (ModelDriven)
> > action;
> >
So is this 2.0.9 javadoc correct?
public interface ModelDriven {
/**
* @return the model to be pushed onto the ValueStack instead of the
Action itself
*/
T getModel();
}
This sort of sound like the Action IS NOT ALSO on the stack!
On 9/21/07, Dave Newton <[EMAIL PROTECTED]>
--- [EMAIL PROTECTED] wrote:
> Is there anything that ModelDriven does other than
> push your model on the top of the stack?
public String intercept(ActionInvocation invocation)
throws Exception {
Object action = invocation.getAction();
if (action instanceof ModelDriven) {
ModelDri
Thorsten Schäfer wrote:
I'm currently taking a look at Struts 2 and I particularly like getting
rid of ActionForms. As I understand, WebWorks/Struts2 offers two ways to
map forms to business domain objects:
1. I can provide a getter method (getDomainObject()) in the action and
refer to its proper
by telephone or email and destroy the original
message without making a copy. Thank you.
- Original Message -
From: "Matt Luce" <[EMAIL PROTECTED]>
To:
Sent: Monday, June 11, 2007 8:51 PM
Subject: RE: ModelDriven interface
After working on this for a while, I beginni
After working on this for a while, I beginning to think that that
ModelDriven interface is not what I had thought it was. It is certainly not
a replacement for the formBeans in Struts 1. I guess I just need to forget
most of what I've used in Struts 1 :) Thanks all for your help.
Here is the flow of my tiny app:
listAction -> list.jsp -> selectAction -> update.jsp -> updateAction
(implements ModelDriven - getModel() returns the object selected in
list.jsp stored in session )
Once it gets to update.jsp, the form should show the values of the bean
selected on list.jsp. Bu
I'm using the default stack. What I'm trying to do is something very
simple, that was incredibly straightforward in Struts 1. What I'm
finding is the getModel() method is not getting called when I expect it
to. It doesn't get called until after the action has been "hit" once.
But that doesn't he
--- [EMAIL PROTECTED] wrote:
> I agree, it should be on the stack, but the values
> don't show up. Does anyone have an example of this
> that works?
I have a ScopedModelDriven example, but it's really,
really boring.
IIRC there's a ModelDriven example in showcase, but
it's even more boring than
I agree, it should be on the stack, but the values don't show up. Does
anyone have an example of this that works?
Then why have the modelDriven interface at all? What use is it?
Matt Luce
Wells Fargo Funds Management, LLC
414.577.7927
414.359.3537 Fax
--- Nicolás Pace <[EMAIL PROTECTED]> wrote:
> The correct way of populating the values IS
> declaring the getters and setters for each object
you
> want to populate.
If you implement ModelDriven then the model object
returned should be on the object stack allowing
non-qualified access on the form
On 6/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I'm working with Struts 2.0.6 and I'm trying to use the ModelDriven
Interface. However, I seem to be having some troubles. My actionClass
implements ModelDriven, but the values on the page don't fill with the
values of the object returned
The point of ModelDriven is that we don't have to refer to the
"parent" or "model" property. We can just refer to the property
flat-out, as if it were a property of the Action class.
In this case, it might be that the reference should be to
child.property, rather than parent.child.property, since
--- [EMAIL PROTECTED] wrote:
> Does S2 limitthe depth to which Action Domain
objects
> can be populated?
Not as far as I know... I have three-deep fields that
work. I *may* (haven't checked in awhile) have
left-over null-creation configs, but I don't know if
they're (still?) necessary or not.
> L
79 matches
Mail list logo