If you look at the  Apache OFBiz Development - The Beginner book, it says
the following in the Java Events section:-
-----------------------
The Java method thus invoked must comply with a convention, an exact
signature comprising:
a static keyword that makes it a class method, not an instance method
a return of type java.lang.String
two parameters of type javax.servlet.http.HttpServletRequest and
javax.servlet.http.HttpServletResponse
-------------------------

So, you get HttpServletResponse as a parameter to the Java service method.

-Aswath

On Tue, May 5, 2009 at 2:16 PM, tanzeem.mb <[email protected]> wrote:

>
> Hi
>
> I am trying to get a dynamically generated excel report to be streamed back
> to the browser.
> How should i write my java method so that i can use the HTTPServletResponze
> and org.ofbiz.base.util.UtilHttp.streamContentToBrowser(HttpServletResponse
> response, byte[] bytes, java.lang.String contentType) to return data.
>
> My request-response map is as below:
>
> <request-map uri="createReport">
>        <security https="true" auth="true"/>
>        <event type="service" invoke="crmsfa.createReport"/>
>        <response name="success" type="view" value="showReport"/>
>
>        <response name="error" type="request-redirect" value="viewReport"/>
>    </request-map>
>
> What changes should i make to the following method .
> public static Map createReport(DispatchContext dctx, Map context) {
> --------
> --------
> }
>
> How can i make the HTTPServletResponse object available in my java service
> method
>
> Can anyone give any sample java file using HTTPServletResponse object in
> the
> service method
>
> Thanks
> Tanzeem
> --
> View this message in context:
> http://www.nabble.com/Generating-excel-report-tp23383400p23383400.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>

Reply via email to