The documentation does actually mention the ApplicationStateManager
service, and if you take a look at the Javadocs, it's mentioned all over
in the application state related classes.
-Filip
César Lesc skrev:
Thank you all for the advice, I'm using now the
ApplicationStateManager service, its
Thank you all for the advice, I'm using now the
ApplicationStateManager service, its look better than using the
RequestGlobals, the T5 core Application State documentation does not
mention this service but i think it should because is very useful.
César.
--
I usually expose commonly used ASOs through a wrapper service, like
CurrentUser for a User ASO. Works quite nice and gives me a place to put
various user related methods.
-Filip
Kevin Menard skrev:
Hmm . . . I haven't really gotten my feet wet with T5 yet. Does this mean
that it will still o
In T4, you'd have something like the following to grab a global Cayenne
DataContext:
public void setDataContext(final ApplicationStateManager asm)
{
this.dc = (DataContext) asm.get("global-data-context");
}
Exposing the name of the ASO and having to do a cast is not nice. I'll have
to check
Hm... it would certainly be nice if a service could have an ASO
injected into it directly, but that would then mandate a particular
scope to your service.
I personally like the approach of injecting the ASM into the service
and grabbing your ASO's from there. Not familiar with the T4
Appli
Well, many of the methods of this service needs the user name (from the ASO)
for security constraints, i don't want pollute the service interface with a
parameter that is almost a constant (for each user), when can be easily
grabbed from the session, and don't have to repeat the code to obtain the
Hmm . . . I haven't really gotten my feet wet with T5 yet. Does this mean
that it will still only inject into page classes, as is the case with T4? I
was hoping with the move to POJOs that you could inject into arbitrary
classes, such as services. The ASM is a pain to use.
--
Kevin
On 9/12/0
Have a look at the ApplicationStateManager service:
http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/services/ApplicationStateManager.html
-Filip
César Lesc skrev:
I need to use data stored in an ASO (user information) to process the a
requests in a service object,
Sorry to ask the obvious, but is there some reason you can't just pass
the ASO into the relevant service method:
class Page {
@ASO aso;
@Inject service;
void onAction() {
service.doSomethingWith(aso);
}
}
I'm sure your situation's more complicated - just had to get the
obvious out of
I need to use data stored in an ASO (user information) to process the a
requests in a service object, i guess the service object must be in
perthread scope, because the ASO stores his data in the session, but the
@ApplicationState annotation is not working inside the service. Finally i
found the Re
10 matches
Mail list logo