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

Enrico Ballarin Dolfin enrico at sed.ethz.ch
Mon Jul 23 09:26:31 CEST 2012


Hi Yves,

On Friday 20 July 2012 21:14:38 Yves Glodt wrote:
> 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.

could you please give me more information?

Do you have a tag library example or a link to a similar solution?

Many thanks
Enrico

> 
> 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



More information about the opencms-dev mailing list