creating CGI_Impersonator in Webmacro-Spring env

Hai-Chen Tu <[email protected]>
Newsgroups gmane.comp.java.webmacro.user
Message-ID <[email protected]>
Sebastian,
	I searched all the ContextTools code and found that
	CGI_Impersonator is the only class that needs to
	access ServletContext and it also assumes that
	the broker is a ServletBroker (see code below).

    		CGI_Impersonator(WebContext wc) {
       			requst_ = wc.getRequest();
       			// this is not very nice, but I don't see any other
       			// possibility to get the servlet context. We should
			// provide a method in WebContext to hide this from our users.
		      	sc_ = ((ServletBroker) wc.getBroker()).getServletContext();
    		}

	Without this problem, I think we can use a regular WM (i.e., not
	initialized with a ServletBroker) as the base for WebMacro engine in Spring.
	And we can use WebContext inside WebMacroView for servlet application and
	regular Context for other usages (e.g., email templates).

	Also, I think the main reasons for having Servlet20Broker/Servlet22Broker are
	to add few more places for locating property files, templates, and other
	resources and to use ServletContext.log(...) for logging purpose. They 
probably
	should be replaced by Spring-friendly ones, e.g.,  like the way your have
	implemented.

	So the question now is how to address the CGI issue. Comments?
Hai-Chen Tu




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.