Em Wed, 21 Jan 2009 10:59:41 -0300, Sid Ferreira <sid....@gmail.com> escreveu:

1) Create a MyContextService, wich has an ApplicationState object

Tapestry-IoC services cannot use the @ApplicationState annotation. If they need to access ASOs, they need to use the ApplicationStateManager.

2) Create a @Private annotation (Dispatcher docs, but not clear how to
finish it)

It can be any annotation you fancy. @Private was just the name the wiki article author chose.

3) Create 2 pages, one to login and another to list, wich extends
MyContextService

Pages can't be services, but they can use them (through @Inject).

4) Create a dispatcher, wich extends MyContextService

The dispatcher would use your service, not extend it.

the idea:
1) Dispatcher is called, identify the client and set/reset it
2) If user is logged (didn't decided this part yet) it validates the Client
- User relation
3) If not logged, check if has a submit and try to login
4) If now the user is not logged, forward in server side to the login
5) Dispatcher forward to list

It seems ok.

So, the questions:
1) How to finish up the @Private? (
http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess) I dunno what to
ser in the type for instance

This annotation is just a marker. Annotations can't have code nor logic.
Reading your "1 week of Tapestry" message, I got the impression that you're not familiar with Java yet. Therefore, I strongly suggest you to really understand Java before learning Tapestry. You must really understand OOP and Java to use Tapestry really well.

2) How to server-side forward?

RTFM! (hehehe, sorry, I coundn't resist) http://tapestry.apache.org/tapestry5/guide/pagenav.html.

3) Using ASO (or AOS?) in a super class, isn't the same (and so useless to do) to have a protected static property in MyContextService?

ASOs must be private fields, but you can write a protected getter. ;)
A static property in a service would be just one variable for the whole application. As you need separate state (session) for each user, it must be an ASO.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to