Re: creating CGI_Impersonator in Webmacro-Spring env
Hai-Chen Tu <[email protected]>
| Newsgroups | gmane.comp.java.webmacro.user |
|---|---|
| Message-ID | <[email protected]> |
Lane,
I searched Servlet JavaDoc and found out that one can use
request.getSession().getServletContext() to retrieve the servlet
context.
This getServletContext() method is available since Servlet 2.3.
Hai-Chen Tu
At 01:22 PM 10/1/2004, Lane Sharman wrote:
>Hai,
>
>I would deprecate the class or modify the class in support of the
>initiative and we will release 2.0 WM with this change as a release note.
>If you can modify CGIImpersonator and retain its functionality, do that.
>If not, we will deprecate the class entirely.
>
>-Lane
>
>Hai-Chen Tu wrote:
>
>>Lane,
>> I used $CGI for debugging purpose (dump form parameters)
>> but I can easily switch to $Request for the same result.
>>Hai-Chen
>>
>>At 12:49 PM 10/1/2004, Lane Sharman wrote:
>>
>>>cgi impersonator is not a mainline class and could be deprecated to
>>>support this initiative.
>>>
>>>-Lane
>>>
>>>Hai-Chen Tu wrote:
>>>
>>>>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
>>>>_______________________________________________
>>>>Webmacro-user mailing list
>>>>[email protected]
>>>>https://lists.sourceforge.net/lists/listinfo/webmacro-user
>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>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
>>>_______________________________________________
>>>Webmacro-user mailing list
>>>[email protected]
>>>https://lists.sourceforge.net/lists/listinfo/webmacro-user
>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>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
>>_______________________________________________
>>Webmacro-user mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/webmacro-user
-------------------------------------------------------
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