Struts + form = No probs - Problems for simpler things ...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   joey_corleon
Posted On:   Sunday, October 27, 2002 12:16 PM

Hi, I have done a little application that asks users info to register and everything works well - everything is clear. Now, I have some problems to do something as silly simple as displaying the list of all the users. I am Ok with iterators etc ... My problem is that in this case (plain text in a table) I don't know how to call my business logic bean (stored within the application scope) - then call the required method from this business logic bean to build the bean that is finaly going to be used by the neted tag to display the info I am interested in :o( ... Where and how to I build this intermediate bean?! Do I have to do this via scriptlets within my JSP?? Thanks for your help!    More>>

Hi,


I have done a little application that asks users info to register and everything works well - everything is clear.


Now, I have some problems to do something as silly simple as displaying the list of all the users.

I am Ok with iterators etc ... My problem is that in this case (plain text in a table) I don't know how to call my business logic bean (stored within the application scope) - then call the required method from this business logic bean to build the bean that is finaly going to be used by the neted tag to display the info I am interested in :o( ...


Where and how to I build this intermediate bean?! Do I have to do this via scriptlets within my JSP??
Thanks for your help!

   <<Less

Re: Struts + form = No probs - Problems for simpler things ...

Posted By:   Nic_Daniau  
Posted On:   Thursday, October 31, 2002 04:04 AM

The way I would do it is have an action (and not your JSP) as the entry point of the report mini-application. something like report.do where I would do my calls to the business objects, store the result in the request (or session depending if you need to do something with it thereafter), then forward to your JSP mapping. users would never see Report.jsp in their addess bar.


generally, I tend to avoid exposing any *.jsp URLs, I just provide *.do URLs, even when I have no initialization to do. First it's more flexible (e.g. initialization becomes necessary in version 2 of my app) and it's more consistent with MVC and the struts framework: actions act on behalf of the controler servlet and it's a better idea to let it deal with forwarding to the correct JSP, including when it's this JSP displays something like a home page.


hth

About | Sitemap | Contact