hi,

If are getting some collection to the JSP page and just wish to display a
subset of them without changing anything on BL layer, Use Pager Taglib and
get away with it easily.

But there is a downside to it as you may have 1000 records and you just want
to show 10. So, 990 records are burden on network for no use at all.

But you can avoid this also. Pager taglib provides you with one parameter
"offset" that can be passed onto the controller layer and then to your
Session EJB. Session EJB will trim the 1000 records collection obtained to
10 records based on that offset value. Now when you pass the DTO back, it
will contain maximum 10 records. Reducing network load and you get only
those records that you want in presentation layer.

HTH
navjot singh

|-----Original Message-----
|From: Keith Pemberton [mailto:[EMAIL PROTECTED]
|Sent: Sunday, August 24, 2003 7:09 PM
|To: [EMAIL PROTECTED]
|Subject: Design question...
|
|
|I have a JSP page that contains entries from a database.  I am getting
|the items using a DTO that is passed from a session EJB.  What I would
|like to be able to do is to specify a parameter in the URL named
|"offset" that when changed would display the next results from the
|database.  Couple of questions... Would it be considered "presentation"
|logic to perform the action of getting the DTO from the session bean
|within the JSP page?  I really don't want to do it that way because I'm
|trying to keep the layers as separate as possible.  So, if I don't do it
|that way, I will have to use Action classes and html:links that can pass
|the parameter to action class?
|
|My real question is what is the best way of dealing with EJBs in the
|presentation layer?  I know that I have to get a DTO of the information
|that I want, but usually the methods of the DTO take parameters that I
|can't pass to the DTO in the JSP page.  I have read over and over the
|Oreilly Struts book but it still is confusing me.  Thanks for any help!
|
|Keith Pemberton
|--
|Keith Pemberton <[EMAIL PROTECTED]>
|
|
|---------------------------------------------------------------------
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|
|


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to