Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Craig McClanahan
On 9/9/05, Rick Reumann <[EMAIL PROTECTED]> wrote: > > Craig McClanahan wrote the following on 9/9/2005 12:18 PM: > > > For Shale in particular, the "application controller" part of Shale is > > implemented as a Commons Chain chain (similar in spirit to what's going > on > > with Struts 1.3's re

Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Gary VanMatre
This is another example: http://svn.apache.org/viewcvs.cgi/struts/shale/trunk/clayplugin/src/java/org/apache/shale/clay/faces/ClayViewHandlerCommand.java?view=markup The only requirement is that the command's implement the Command interface. The common chains is a pretty sweet idea (http://jak

Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread gramani
Rick Reumann <[EMAIL PROTECTED]> wrote on 09/09/2005 12:36:39 PM: > Craig McClanahan wrote the following on 9/9/2005 12:18 PM: > > > For Shale in particular, the "application controller" part of Shale is > > implemented as a Commons Chain chain (similar in spirit to what's going on > > with S

Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Rick Reumann
Craig McClanahan wrote the following on 9/9/2005 12:18 PM: For Shale in particular, the "application controller" part of Shale is implemented as a Commons Chain chain (similar in spirit to what's going on with Struts 1.3's request processor), so you can also implement a check like this as one

Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread gramani
Gary, Rick, Craig: thanks very much! Geeta

Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Craig McClanahan
On 9/9/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Rick Reumann <[EMAIL PROTECTED]> wrote on 09/09/2005 12:01:48 PM: > > > > > I would think JSF could use regular servlet filters? If so, that's where > > > I'd do stuff that you want checked on almost every request. Even in > > Struts, I

Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Gary VanMatre
>Thanks for your response Gary. Maybe I misunderstand your suggestion, but >I think you are telling me how to get "userName". But here's my real >question: don't you end up writing code like: > >String userName = getBean("sessionScope.userName"); >if (userName == null) return "loggedOff"; > >in

Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread gramani
Rick Reumann <[EMAIL PROTECTED]> wrote on 09/09/2005 12:01:48 PM: > > I would think JSF could use regular servlet filters? If so, that's where > I'd do stuff that you want checked on almost every request. Even in > Struts, I wouldn't touch the RequestProcessor. Use a ServletFilter. oh yes, c

Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread gramani
[EMAIL PROTECTED] (Gary VanMatre) wrote on 09/09/2005 11:49:12 AM: > There are several ways to handle this, maybe too many options: > > From a view controller: > >String userName = getBean("sessionScope.userName"); Thanks for your response Gary. Maybe I misunderstand your suggestion, but I

Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Rick Reumann
[EMAIL PROTECTED] wrote the following on 9/9/2005 10:19 AM: I can see myself doing this check many times in many methods in many backing beans (which extend AbstractViewController). What is the appropriate way to implement this check - or for that matter any other common code? I can of course

Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Gary VanMatre
There are several ways to handle this, maybe too many options: >From a view controller: String userName = getBean("sessionScope.userName"); Or, create a managed bean with the parameter like a Struts form bean: userParms myobject request userName #{sessionScope.user

[Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread gramani
Hi all: I am making small and halting progress with my Shale application and have this pretty fundamental question. Suppose my backing bean has this code: public String getWorkList() { String username = (String) FacesContext.getCurrentInstance() .getExternalContext().getSessionMap()