Hi All,
I have a current architecture which I think could be imporved.
It goes as follows
1)html page to call servlet_1,
2)servlet_1 then calls EJB
3)jsp then calls a proxy_servlet which calls servlet_1 which calls EJB and populates jsp with values.
Is there a better way to do this?
-
Better Design for system (4 messages)
- Posted by: Berb Akmal
- Posted on: February 06 2001 11:09 EST
Threaded Messages (4)
- Better Design for system by Bhargav Srirangam on February 06 2001 14:19 EST
- Better Design for system by Berb Akmal on February 07 2001 04:03 EST
- Better Design for system by Justin Van Vorst on February 07 2001 03:16 EST
- Better Design for system by Berb Akmal on February 07 2001 04:03 EST
- Better Design for system by Dipsy N on February 06 2001 16:23 EST
-
Better Design for system[ Go to top ]
- Posted by: Bhargav Srirangam
- Posted on: February 06 2001 14:19 EST
- in response to Berb Akmal
Hi,
could u give more info on what servlet_1 is being used for??is it acting like a controller?? -
Better Design for system[ Go to top ]
- Posted by: Berb Akmal
- Posted on: February 07 2001 04:03 EST
- in response to Bhargav Srirangam
Servlet_1 manipulates the data entered in the html page to format it properly for the EJB. I have looked at patterns for getting back data to the EJB to the JSP. The only one I came across was the proxy type pattern. Where the JSP talks to the proxy_servlet which talks to the EJB (Stateful session). I am using Websphere 3.52 advanced edition. That might have some bearing on what options are available to me.
Berb. -
Better Design for system[ Go to top ]
- Posted by: Justin Van Vorst
- Posted on: February 07 2001 15:16 EST
- in response to Berb Akmal
Berb,
I would recommend the following pattern:
1) client sends Request to servlet_1,
2) servlet_1 then calls EJB, and gets some data
3) servlet_1 stores data in HttpSession
4) servlet_1 forwards Req/Resp pair to the appropriate jsp
5) jsp pulls data from HttpSession
6) jsp builds page
7) jsp sends response to client
8) go to line 1...
This has a quite a few benefits:
- Only need to write one servlet for many JSPs.
- The JSP writer does not need to worry about navigation, since the Servlet handles it.
- JSP code is simpler since there is no need to call EJB.
- If there are any future changes or additions you will only need to update the Servlets navigation routine.
As you can see I would strongly disagree with Deepika, since I prefer to control the level of interaction by various parts of the system.
-JC
-
Better Design for system[ Go to top ]
- Posted by: Dipsy N
- Posted on: February 06 2001 16:23 EST
- in response to Berb Akmal
Your JSP can call your entity/session bean directly.
Html calling a servlet, or JSP calling a servlet is redundant.
Create your JSP which separates the design from your data, and invoke your bean from JSP.
Hope this helps you :-)