Hi David..
i did not understand fully your question.....
but i can say what was my initial approach....then i think u can simply
modify it somewhere for getting what u want:
i had the following situation:
- i have 3 set of 4 JSP regarding users, groups and profiles..
- each set is associated with a JavaBean...the reason why i did like this is
that each operation regarding users involves
almost the same set of properties...
- the JavaBeans are COMPLETELY UNAWARE that they're part of a Web
Application...THERE IS NO processRequest or request.getParameter in the
JavaBeans....
- i have only one public method, called 'doCommand', and based on that one
of delete/query/modify/add method is called,
and that method use the properties that are more suitable for its purposes
well, with this approach the Java code in the JSP is not much...however i
have some situations in which i have to
manage some parameters from the request....and i manage it in the JSP (Good
'cause JavaBeans are unaware of request ecc.., Bad 'cause the JSP has more
Java code)....
obviously..this approach is not very good (JavaBeans, for my way of
thinking, should only be composed of get/set methods, without logic at
all..)
but let me say that if u manage each of the parameters in the Action....then
u do your logic in the Action and when
u have the results u store it into the JavaBean.....doing so in your
JavaBean u have only get/set...and it is the
Action interface that set the properties of the JavaBean....
so this approach would be JSP->servlet->Action->JavaBean->JSP
or , like i did...do
JSP->JavaBean->Action->JavaBean->JSP..
it's what comes first into my mind....but doing so it's not Model 2 i
guess...
actually...i am also thinking of a way to combine Model 1 & Model 2
architecture in a way so that also
the Action interfaces are completely unaware of being part of a web
application....
any help??
regards
marco
> -----Original Message-----
> From: EXT Kevin Duffey [mailto:[EMAIL PROTECTED]]
> Sent: 11. April 2000 18:34
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: More on Model 2/little confused
>
>
> Hi again,
>
>
> I am curious if there is a better way to get many form/pages worth of
> request parameters in a better fashion than each action
> having from 1 to
> infinte number of
>
> bean.setXXX( request.getParameter("XXX") );
>
> On my Enrollment page I had 32 lines of this, which isn't a
> big deal..but
> its killing for a loop of some kind! I am not familiar with how to do
> reflection, but it would be great if I could implement a way
> to do what the
> Model 1 JSP/JavaBean does, by taking the request parameter,
> and applying it
> to a "set" string and get the method to call. Can anyone
> explain how to do
> this? I will dig up some dirt on it..but if anyone has done this using
> reflection the way JSP engines do it, that would be great.
>
> On that note, is using reflection a lot slower than the multiple
> request.getParameter() calls? I don't want to eat up cpu just
> to save a few
> lines of code..not to mention most java developers,
> especially beginners,
> may not know reflection upon seeing it in use, thus its a bit
> harder to
> understand. Oh..I would ideally want a single method that all
> action classes
> can use, possibly a static one, to turn the request
> parameters into a bunch
> of setXXX calls and actually call the setXXX methods of each
> action classes
> bean instance.
>
> Thanks.
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets