I have a design problem, around creating screen factories using JSPs, which
I am trying to solve.....
Goals:
* Design a screen factory which is scalable (easy to produce 10
screens or 500 screens)
* Allow look and feel of screens to be changed globally with changes
to as few places as possible
(Note: we follow Model 2 in which the HTML interacts with servlets which
interact with EJBs and then redirect to the appropriate JSP page which have
HTML tags and useBean tags and minimal (none?) Java code....)
Solution 1:
* JSP is written with HTML tags and useBean tags to create dynamic
pages
* EJBs interfacing with JSPs have business logic and interact with the
database
* Con: If screens look and feel changes, each of the JSPs affected,
has to be changed hence our second goal cannot be achieved
* Con: How do dynamic tables get generated? Say the rows are stored in
a result set which ony of my enrity beans has, and the jsp has the table
HTML tags <td> / <tr> etc.....Do we use repeat tags to get all the rows from
the EJB. (remember another goal in this model is to have minimal Java code
in the JSP so that visual designers can understand the JSPs more easily.
* Pro: Visual designers can work with JSPs easily and see what they
contain. JSP designer tools (i havent used any) can be used easily
Solution 2:
* JSP has NO HTML code. It only has getProperty tags (or include tags)
which call EJBs which are configured to spit out HTML tagged code. Hence, if
a table needs to be generated, the JSP could either
* say "include myTable.jsp" where myTable.jsp has code which says
"useProperty name="myTable" " where the bean return the HTML code which
renders the table
* or directly say "useProperty......." so that it calls a table bean
which spits out the HTML code for the table
* Pro: JSP is really thin and this model allows reuseable components
(EJBs). For example, one table bean I write I could use in multiple JSPs by
just setting the useProperty tag in each of the JSPs
* Pro: Customization of components can be done in a few places and
does not have to be done for each screen. as i mentioned, reuseable,
customizable components could be created.
* Con: Since theres no HTML code in the JSPs, visual designers are
virtually useless since they cannot "see" the JSP. Debugging may be an issue
if one of the components is not generating HTML code properly..
Please share your thoughts and experiences regarding this issue.......
Thank you,
Rupesh.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html