Adam Ruggles wrote:
As far as interceptors look at the docs/source code. If your writing
your own interceptor then you can control when it is executed.
So here is a scenario for you. Two users are working on the same
account. User 1 updates the address. Now user 2 updates the
address. Since you are not re-fetching the data from the database,
user 1 will not know of the change. Even if he/she refreshes the page.
I am aware of this. However, I am willing to implement (learn hibernate)
but for now, and just to get started, I need to write a small
application (Every person learn in different way). I can not start
learning many frameworks at the same time, and I would like to focus
only in struts2. In the future, I'll re-factor my code or modify it to
suit struts2, and by then I will learn how to design applications for
struts2.
So far, I am convinced that it's not easier than jsf or .net, and before
designing a business logic you should keep in mind that it's only to be
used with Struts2. Unlike other frameworks. May be because this is the
only MVC2 I am trying to discover.
I 'll keep on trying to get where I want in struts2 and I'll let you know.
After all, thank you. You and Dave were allot of help. I need your
opinion about this design. Is that the only disadvantage of this design ?
Mansour wrote:
Adam Ruggles wrote:
The problem with the store in session solution is what if two people
are working on the same account at the same time?
Hummm,
Good point. But wait ! what's wrong with this ? they don't have
access to each other sessions. May be store it in the request ?
Now how do I get a variable from the page and store it in the request
or session through an interceptor.
example:
public String intercept(ActionInvocation invocation) throws Exception {
//I need to get some variable from the page called account
that holds an object of Account
AccountAction action =
(AccountAction)invocation.getAction();
action.setAccount( theAccountFromThePage);
return "beer";
}
And how do I know if the Interceptor being processed before of after
the action ?
Mansour wrote:
Dave Newton wrote:
--- Mansour <[EMAIL PROTECTED]> wrote:
I see what you mean now. and after I call update,
then I have to populate it again to redisplay the modified
account. There's now not to re-select form the DB.
Unless it's stored in session or the form contained
all the data you needed to re-display I don't see how
reloading the bean could be avoided.
Perfect, now we are talking. So, I can store the Account obj in a
request or session.
What I am going to do, write an interceptor to set the account in
the request, and I think this should do it.
right ?
Can I push it into the stack ? Is there away ?
d.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]