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
  • 1.  session variables

    Posted 08/04/02 06:39 PM

    Hi,

    just found the session-vars in Xapp 3.13 which help a lot :slight_smile:

    One thing I still can’t do with them is checking for existance in a scriptlet.

    I tried to use “<% if (sessioncontext.getVariablesHandler().getVariable(“meineQuery”) != null) … %>” like it’s done in the getVar-Tag but that doesn’t work.

    If I cannot do this, maybe I can set and get a session-variable completely with scriptlets, without setvar/getvar?

    Thank you,

    Ralf.


    #Tamino
    #webMethods
    #API-Management


  • 2.  RE: session variables

    Posted 08/05/02 09:50 AM

    Hello,

    perhaps, the method ‘getVariableValue’ of the class VariablesHandler is the method you are looking for.
    The method you used evaluates the variable while the getVariableValue returns the mapped string only.

    For more detail, have a look at the Java Docs of X-Application. I hope, this helps you.

    Bye,
    Christian.


    #webMethods
    #Tamino
    #API-Management


  • 3.  RE: session variables

    Posted 08/05/02 09:51 AM

    Hello,

    this topic will be moved to the Assistance Forum in the next days.
    The assistance forum is intended to be used for technical questions and answers.

    Thank you for your understanding.

    Regards,
    Christian.


    #Tamino
    #webMethods
    #API-Management


  • 4.  RE: session variables

    Posted 08/05/02 01:25 PM

    when I was born, algol 60 was still in fashion, so pls. have some patience with me …

    When I refer to "sessionContext. "… (as it’s done in the getvar tag ) in a scriptlet, I get an exception (sessionContext not known). That’s probably boring for all of you Java-Masters, but not for me …

    <bdm:setvar name = “meineQuery” scope = “session”>
    1234567
    </bdm:setvar>

    now, what’s wrong here?

    <% if (sessionContext.getVariablesHandler().getVariableValue(“meineQuery”) != null) … %>

    Can you pls help once more?

    Ralf.


    #webMethods
    #Tamino
    #API-Management


  • 5.  RE: session variables

    Posted 08/05/02 02:57 PM

    Hello,

    when adding Scriptlet code to your page you have to import the classes you want to use and to declare your variables:

    <BR><%@ page language="java" contentType="text/html; charset=UTF-8" <BR>    <B>import="com.softwareag.xtools.xapplication.jsp.ServletSessionContext, <BR>            com.softwareag.xtools.xapplication.jsp.SessionContext"</B><BR>%><BR></pre><BR><BR>After the import you must declare and initialize the variable ?sessionConext? before using it.<BR><BR><pre class="ip-ubbcode-code-pre"><BR><% SessionContext sessionContext =  ServletSessionContext.getSessionContext(pageContext); <BR>       if (sessionContext.getVariablesHandler().getVariableValue("meineQuery") != null)<BR>	...<BR>%><BR>



    Bye,
    Christian.


    #Tamino
    #API-Management
    #webMethods


  • 6.  RE: session variables

    Posted 08/05/02 06:12 PM

    for helping again. Everything works as it should.

    Ralf.


    #Tamino
    #API-Management
    #webMethods