IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

Using a Javabean value in a directelementaction

  • 1.  Using a Javabean value in a directelementaction

    Posted 04/03/03 03:16 PM

    X-Application Version: 4.1.1
    Tamino Version : 4.1.1
    Platform : Win2k
    WebContainer : Tomcat 4.1.1
    JDK Version : 1.4.1, 1.3.1

    I’m trying to use a value from a javabean as the arg in directelementaction, but it’s not translating the value – it’s setting the element to the literal string. Any ideas how to do this?

    <%
    util.UniqueId uid = bean_UniqueId.getInstance();
    String id = uid.getIdentifierString();
    out.print(“UID = " + id);
    %>
    <xapp:directelementaction type=“setValue” select=”/CapabilityType/@id" arg=“<%out.print(id);%>”>
    </xapp:directelementaction>

    Sets the value to: “<%out.print(id);%>”


    #Tamino
    #API-Management
    #webMethods


  • 2.  RE: Using a Javabean value in a directelementaction

    Posted 04/03/03 04:08 PM

    JSP does not evaluate <% … …%> stuff within attribute values.

    What you could do is: directly modify the document in your scriptlet. The following
    code should do so:

    Add

    <%@ page import=“com.softwareag.xtools.xapplication.jsp." %>
    <%@ page import="com.softwareag.xtools.xapplication.businessdocument.
    ” %>

    at the top of your page.
    And modify your scriptlet as follows:

    <%
    <compute ‘id’ like before>;

    SessionContext sc = ServletSessionContext.getSessionContext(pageContext);
    BusinessDocument doc = sc.getDocument(“yourDocName”);
    doc.selectAttribute(“/CapabilityType/@id”).setValue(id);
    %>

    Make sure to adjust “yourDocName” to the document name you used in your jsp page.

    Michael

    Software AG Germany, Darmstadt


    #webMethods
    #Tamino
    #API-Management