[opencms-dev] How to include results of a webservice call into a JSP that generates an opencms 8.0.0 page?

Yves Glodt yg at mind.lu
Fri Jul 20 23:14:38 CEST 2012


If you are willing to add another layer, you could implement a tag library
which transforms the data returned from the WebService into html or
something else. I did that with success and used it in many projects. Let
me know if you need more information.

On 20 July 2012 11:44, Enrico Ballarin Dolfin <enrico at sed.ethz.ch> wrote:

> Hi,
>
> I'm looking for a way to include results of a webservice call into a JSP
> that
> generates an OpenCms 8.0.0 page.
>
>
> The webservice calls can returns a PNG image, a text, an XML file, etc,
> that
> is stored in a DB table as blob field.
>
>
> For the webservice call I'm using a syntax similar to this:
>
> /MyServices/GetPngBlob?parameter=...
> /MyServices/GetXmlBlob?parameter=...
> /MyServices/GetTextBlob?parameter=...
>
>
> While this approach works well for PNG images, e.g.
>
> <p><img src="/MyServices/GetPngBlob?param2=<%= value %>" /></p>
>
> I'm having problems to use the GetTextBlob and the GetXmlBlob service:
> I need to call the service and to store the result of the service call in a
> JSP variable (e.g. String data) and then to display it in HTML:
>
> <p><%= data %></p>
>
>
> The JSP that I use to generate the page has a structure like this and uses
> a
> bean that I have programmed in Java to be able to access an other DB:
>
> -------------------------------------------------
> <%@page buffer="none" session="false" taglibs="c,cms"
>     import="java.util.*,org.apache.log4j.*,mypackage.opencms.v8.dbtable.*"
> %>
>
> <%=
>     // create the bean and the other needed objects
>     DBTableJspTemplate dbtable = new DBTableJspTemplate(pageContext,
> request,
> response);
>
>     String param1 = request.getParameter("param1");
> ...
> ...
>
> %>
>
> <cms:formatter var="content" val="value">
>
> <div class="dbtable">
>
> ...
> ...
>
> </div>
>
> </cms:formatter>
> -------------------------------------------------
>
>
> Any idea how can I perform the webservice call inside my JSP ?
>
> Many thanks
> Enrico
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20120720/e6ce12ec/attachment.htm>


More information about the opencms-dev mailing list