on 07-30-2009 12:13 AM
Hi all,
Is there a way in BLS to:
1. modify an existing session parameter
2. create a new session parameter
3. remove a session parameter
I can do it in javascript with an applet, but would prefer all processing
that is possible on the server, stay on the server.
--Thanks,
--Amy Smith
Hi,
Execute the PropertyAccessServlet service from BLS (use XML query) to manage the session variables:
/XMII/PropertyAccessServlet?mode=store&PropName=<name>&PropValue=<value>
/XMII/PropertyAccessServlet?mode=retrieve&PropName=<name>
I don't think any mode is available to delete a session variable. Though you can assign a blank value using the store mode.
Thanks,
Dipankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Dipankar,
So I don't quite understand.
To set the session parameter within a BLS transaction do the following:
1. Create an XML Query with mode XMLQuery.
2. Then in the URL of the XML Query put
/XMII/PropertyAccessServlet?mode=store&PropName=[Param.1]&PropValue=[Param.2]
3. In my BLS transaction, create an XML Query action block that points to the XML Query
4. Set the two params in BLS and execute the XML Query action block
Is this what you meant? (I'm sure it isn't as the XML Query doesn't work!)
Could you be more specific about how to "Execute the PropertyAccessServlet service from BLS"?
What about using an HTTP Post action block?
Thanks for your help,
--Amy Smith
--Haworth
Hi Amy,
Yes you got it correct. Add the Content-type=text/xml at the end of the URL as Michael mentioned, which I missed in my post before. Using this you can save/create or read a session variable in BLS. If you use HTTP Post action you have to provide the server name and port along with the authentication details (username, password) which I think you might not want to hardcode in BLS. Using XML query you don't have to provide any of those as it'll take those from the session itself.
Thanks,
Dipankar
Hi Dipankar,
Thanks... What am I doing wrong?
I do new XMLQuery: Mode is XMLQuery
On the XML Query Details URL:
/XMII/PropertyAccessServlet?mode=store&PropName=[Param.1]&PropValue=[Param.2]&Content-Type=text/xml
On the Parameters tab:
Param.1 value is sessVar
Param.2 value is first
I do a test from the Query editor and get ---> Error: Loaded content is empty
I tried putting values in the URL instead of the params and it gives the same result.
I tried the URL from the browser session and it works.
--Amy Smith
--Haworth
Hi, Dipankar/Amy.
This approach almost certainly will not work from within BLS. The "session" that you'd see is not the same session as the user session, which uses a cookie from the user's browser as an identifying mechanism to the web application server/servlet engine.
There's a big difference between a URL request executed from the user's browser (directly or via a Java applet/AJAX) and a URL request executed by BLS. In the latter case, the request is essentially "anonymous", and most likely, has no knowledge of the user session nor ability to pass along the relevant cookie and session identifiers.
Long answer to say that I don't think you can use BLS to manipulate session variables at present, since the servlet context is not directly accessible to BLS actions. It could be added fairly easily, though. Put in an enhancement request!
Rick
User | Count |
---|---|
11 | |
6 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.