We followed the following architecture:
request response
| *
| *
* *
------------------------
servlet JSP
------------------------
ejb
------------------------
1.Request is given to servlet.
2.servlet fetches data from the Ejb layer
3.servlet forwards data to jsp
4.jsp genreates view to the user
Now we find the following Main TROUBLE with this architecture
The jsp can present only those data that has been provided by the Servlet,i.e. jsp can not demand various differnt types of data from the business layer as it needs.
Reason is Servlet forwards the JSP.
solution we identified is use taglibs to interact with the ejb layer.
jsp will use this tag lib to interact with the business tier.
request/RESPONSE
|
|
-----------------------
jsp ------->TAGLIBS
|
----------------|------
EJB LAYER
Is there any one else who uses such architecture ?
What are the other advantages and disadvantages of this architecture ?
-
New Design Pattern:TAGLIB ONLY.No servlets!! (3 messages)
- Posted by: vimarsh vasavada
- Posted on: June 15 2001 05:05 EDT
Threaded Messages (3)
- New Design Pattern:TAGLIB ONLY.No servlets!! by Alex Pisarev on June 15 2001 08:15 EDT
- New Design Pattern:TAGLIB ONLY.No servlets!! by Wojciech Ozimek on June 16 2001 05:50 EDT
- New Design Pattern:TAGLIB ONLY.No servlets!! by vimarsh vasavada on December 10 2003 04:51 EST
-
New Design Pattern:TAGLIB ONLY.No servlets!![ Go to top ]
- Posted by: Alex Pisarev
- Posted on: June 15 2001 08:15 EDT
- in response to vimarsh vasavada
Taglibs ARE servlets. So what the reason to invent a wheel instead of directly using servlets.
Alex. -
New Design Pattern:TAGLIB ONLY.No servlets!![ Go to top ]
- Posted by: Wojciech Ozimek
- Posted on: June 16 2001 05:50 EDT
- in response to vimarsh vasavada
The architecture you've just presented is a part of the larger pattern called MVC-2. Struts framework is the sample implementation of this pattern (check: http://jakarta.apache.org/struts/index.html). The idea beside the pattern is very simple and staightforward (it was first introduced in Smalltalk). Application is based on:
- Model - which in fact is application logic (EJB's etc.)
- Controller - which is responsible for navigation, workflow and communication between presentation and model
- View or Presentation - which contains only look and feel
The basic benefits of using this patterns in J2EE-based applications are:
- Separation of presentation layer - no Java in JSP's (JSP's are for webmasters, graphicians and all tag-oriented people, they are not supposed to know or learn Java)
- Separation of logic layer - components are built to be reused between applications with different look and feel (example: WAP and WWW banking application)
- Separation of web-flow (workflow) - the webmasters are not hardcoding links inside JSP's. They are using symbolic names or "actions". One can easily change navigation without altering web-pages.
There is a lot of information about MVC and MVC-2 on the network. There is also a lot of open source implementations (Struts is only a sample).
MVC-2 is a very good and usefull pattern for large projects, when you deal with a lot of JSP's, components and user platforms (WAP, WWW, call-center etc.).
Regards
Wojtek -
New Design Pattern:TAGLIB ONLY.No servlets!![ Go to top ]
- Posted by: vimarsh vasavada
- Posted on: December 10 2003 04:51 EST
- in response to Wojciech Ozimek