Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Michael Jouravlev
On 5/4/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: No, sorry, never did get around to reading it... I meant to, but the book is all I've had time for since pretty much January. Yeah, yeah, yeah ;-) I actually really can't wait to be done with it, at least the initial writing. Will it b

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Frank W. Zammetti
No, sorry, never did get around to reading it... I meant to, but the book is all I've had time for since pretty much January. I actually really can't wait to be done with it, at least the initial writing. There's so many things I'd like to be working on right now! The current project, while b

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Michael Jouravlev
My article is out: http://today.java.net/pub/a/today/2006/05/04/almost-portlets.html I bet you haven't read the draft that I've sent you :-) How's your book going? This [EMAIL PROTECTED] article took me almost a month. I updated it 15 times or so. The book... oh, this should be really tough :)

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Frank W. Zammetti
On Thu, May 4, 2006 3:56 pm, Michael Jouravlev said: > I see the value of a dispatch action primarily as input (post-, > submit, accept) action, not as a render (pre-, setup) action. Your > /showAccont.do mapping is a render action, therefore it will likely > not be covered by dispatch action. > >

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Michael Jouravlev
On 5/4/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: On Thu, May 4, 2006 1:59 pm, Michael Jouravlev said: > Code-wise: > > one action class per one logical web resource seems more natural to > me. Say, Employee. I would have one EmployeeForm, one EmployeeAction > and several JSP pages for diff

Re: Securing DispatchActions (was: How to avoid lots of "if else" in Action class.)

2006-05-04 Thread Frank W. Zammetti
Didn't want to hijack a thread, so... On Thu, May 4, 2006 2:21 pm, Dave Newton said: > Frank W. Zammetti wrote: >> I.e., you want /showAccount.do accessible to the AccountManager and >> Customer roles, but you only want /updateAccount.do accessible to the >> AccountManager role? As I understand i

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Dave Newton
Frank W. Zammetti wrote: > I.e., you want /showAccount.do accessible to the AccountManager and Customer > roles, but you only want /updateAccount.do accessible to the AccountManager > role? As I understand it, you would have something like /accountResource.do, > and dispatch to a particular met

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Frank W. Zammetti
On Thu, May 4, 2006 1:59 pm, Michael Jouravlev said: > Code-wise: > > one action class per one logical web resource seems more natural to > me. Say, Employee. I would have one EmployeeForm, one EmployeeAction > and several JSP pages for different modes. All compact and observable > with as little s

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Michael Jouravlev
Code-wise: one action class per one logical web resource seems more natural to me. Say, Employee. I would have one EmployeeForm, one EmployeeAction and several JSP pages for different modes. All compact and observable with as little stuff in config file as possible. But this is just a preference.

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Frank W. Zammetti
And of course the simple option: separate action :) It's absolutely true that a Dispath-type action will get rid of all the if's, and that's good... but you will still be left with a potentially large Action that performs a number of different (hopefully at least related!) functions. Me, I still

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Joey Watson
Thanks Michael. I will study it. On 5/5/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: Dispatching action. Do not use old and crusty DispatchAction. See these links: http://wiki.apache.org/struts/EventActionDispatcher http://wiki.apache.org/struts/DataEntryForm Michael. On 5/4/06, Joey Wats

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Jakub Milkiewicz
THe gold rule use interface to encapsulte behaviour 2006/5/4, Michael Jouravlev <[EMAIL PROTECTED]>: Dispatching action. Do not use old and crusty DispatchAction. See these links: http://wiki.apache.org/struts/EventActionDispatcher http://wiki.apache.org/struts/DataEntryForm Michael. On 5/4/

Re: How to avoid lots of "if else" in Action class.

2006-05-04 Thread Michael Jouravlev
Dispatching action. Do not use old and crusty DispatchAction. See these links: http://wiki.apache.org/struts/EventActionDispatcher http://wiki.apache.org/struts/DataEntryForm Michael. On 5/4/06, Joey Watson <[EMAIL PROTECTED]> wrote: hello everybody. When I was working a big project. I alwa

How to avoid lots of "if else" in Action class.

2006-05-04 Thread Joey Watson
hello everybody. When I was working a big project. I always met this problem. coz the sometimes there are a lot of event need to be handled in a single jsp page. so programer need to use lots of "if - else" to deal with different event in Action.execute method. of cause. I think those codes is