Hello Ted,

Sunday, June 10, 2001, 8:02:47 PM, you wrote:

TH> I agree that most extensions would be best written as independant
TH> servlets that plug into the application alongside the Struts
TH> ActionServlet. Though, I'm not sure they would need to register with the
TH> ActionServlet to access other parts of the framework.

If such resources are stored in application context then I agree with
you. I speak about phasing between core struts
servlet and service servlets. Imagine - core servlet catch request
values, call ActionForm.validate method and depending on result of
this procrssing call or not call Action.perform method. In this case
we have such processing points as -

1. Before request processing
2. Before ActionForm processing
3. After ActionForm processing
4. Before validate call (here can be made call to the validate servlet)
5. After validate call
6. Before Action.perform (here can be made call to the BeanFactory
   servlet)
7. After Action.perform

We can build such mechanism on base of event model, but we needs to
have strong calls order. I view one way to it - ActionServlet init at
application load phase, register itself or some proxy object as
governor to perform registraion service. Service servlets init after
ActionServlet, search governor and register in ActionServlet to
perform some kind of request or response processing - at any phase fro
listed above.

TH> I haven't worked with the Digester directly, but most of the other
TH> Struts services are already exposed through the application context.
TH> Custom tags, for example, already access the Action Mappings this way.
TH> So any other servlet in the application (since that's all JSP's are)
TH> should be able to do the same.

TH> Another example is the Generic Connection Pool. The datasource is
TH> exposed through the application context and other services, like the
TH> TagLibs JDBC tags, can use the pool without knowing anything about
TH> Struts (or Struts knowing anything about them). 

TH> So I would suggest that if there are other services that an extension
TH> needs to share that we expose them through the Application context. 

Yes, I agree with you.

-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]


Reply via email to