Title: Servlets Design Question
Hey, I just tried to use the forward:
 
                RequestDispatcher rd = getServletContext().getRequestDispatcher("/servlet/imx.servlet.broker.GridHandlerServlet");
                rd.forward(request, response);
my JServ 1.1 can't find those classes... Anyone out there developing on the same old POS I am??!! How do you forward using the older Servlet specification? I can't even find the method names on Google.  (Assume my boss will not let me upgrade to Tomcat... took me 2 years to get him to use Velocity, and now even that's outdated... the story of the life!)
 
Arghh!
 
G
-----Original Message-----
From: Greg Nudelman
Sent: Wednesday, July 30, 2003 2:10 PM
To: jdjlist
Cc: Greg Nudelman
Subject: [jdjlist] Servlets Design Question

I'm rewamping an old system with Servlets and a Velocity templating engine.  Servlets talk to the remote app server via a cleint-server protocol.  A typical request then is as follows:

doService(request, response) { //"main method doGet/doPost"

if (action == "getXXX") {

Vector result = callRemoteGetXXX(request);
showUserXXX(result, request, response);

} else if (action == "getYYY") {

//etc.

}



so basically, my main servlet becomes a very bloated file with doService(), as well as all of the  callRemoteGetXXX(request) and showUserXXX(result, request, response) methods of which there are quite a few.  What other accepted designs there are for placing the

callRemoteGetXXX(request) and showUserXXX(result, request, response) methods in separate files? 

1) The old design had loosely grouped actions into types and had an adapter for each type that passed calls around in the context back to the servlet.   All the response calls/formatting was handled in the root CustomServlet superclass.

Not a good idea IMHO.

2) create a RemoteCallManager DAO-type class, where all the (now static) callRemoteGetXXX(request) methods would live:

Vector result = RemoteCallManager.callRemoteGetXXX(request);

For handling of the response, maybe I can stuff the result Vector into the request object and then do some type of Context.forward(responseServletForAllTransactionsOfTypeRelatedToXXX, request, response);

For handling all those responses, they will be loosely grouped into response types and forwarded to 3-4 different "response only"  servlets accordingly.

I like this better, but maybe there is another good way or some implementation/design tricks out there?

Any other ideas?

Thanks in advance.

Greg

P.S. we're on Apache/JServ 1.1/Velocity Java 1.4.1 Solaris








---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk
---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk

Reply via email to