Accessing JSP scope variables

[FONT=Helv][SIZE=2]I am using the WmTomcat package and I would like to be able to invoke a webMethods (version 7) service (using JSPs) such as:

[/SIZE][/FONT][FONT=Courier][SIZE=1][FONT=Courier][SIZE=1]<webm:invoke serviceName=“my.services:getAddressList”>

[/SIZE][/FONT][/SIZE][/FONT][FONT=Helv][SIZE=2]which returns a java.util.List object in the pipeline with elements which have properties such as line1, line2, city, state .

From there, I would like to display this using a standard JSP tag library (that has features like paging, sorting, exporting). Specifically I am using DisplayTag (from Sourceforge http://displaytag.sourceforge.net) but all other standard Java taglibs will have the same issue I have. This is NOT a webMethods-aware library, just a generic Java taglib that takes in a Java object such as a List, Enumeration, Array etc. from request/page/session scope and renders it into a table, such as:

[/SIZE][/FONT][FONT=Courier][SIZE=2][FONT=Courier]<% request.setAttribute( “addressListAttrib”, addressList); %>
<displayTag:table name=“addressListAttrib” />

[/FONT][/SIZE][/FONT][FONT=Helv][SIZE=2]The problem I have is that the webMethods taglibs don’t allow me to get the results from the webMethods world (eg. pipeline) and to in a place that in a place that is known to the Java world (eg. a variable in request/page/session scope etc).

Do I only have the option to use webMethods-provided libraries such as webm:loop etc to get access to this data (thereby losing the ability to use off-the- shelf Java paging, sorting libraries)?
[/SIZE][/FONT]

Hello,
It would probably help that you have export methods in your jsp to pull information out of what transfers back from webMethods. The following is what i use in 6.x:


// get the value for the given key off the pipeline if it exists
public Object getIfParam(com.wm.data.IData p, String key)
{
	Object obj = null;

	if(p != null)
	{
		com.wm.data.IDataCursor i_cursor = p.getCursor();

		if(i_cursor.first(key))
		{
			obj = i_cursor.getValue();
		}

		i_cursor.destroy();
	}

	return obj;
};

// use
<webm:invoke serviceName="wm.tn.profile:getProfileSummaries" />

Java.util.List list = (java.util.List) getIfParam(webm_pipe, "profiles");

There is no simplier way that I know to get at the pipeline. Prototype the output of the service in Developer so you know the structure beforehand. Good day.

Yemi Bedu

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.