http request, response, session objects in xpress forms

Hi guys,

Is there a way to retrieve http request, response or session objects in xpress forms? In other words, something like this in <expansion>:

<script>request.getParameter(".....");</script>

There is a variable "env" that can be used in xpress script tags to retrieve environment variables, but I'm not sure if we can retrieve the above objects.

Thanks in advance.

Adi.

[429 byte] By [adimut] at [2007-11-26 8:59:25]
# 1
Just curious, why would you want to do this?
Indranil_Chakraborty at 2007-7-6 23:02:48 > top of Java-index,Web & Directory Servers,Directory Servers...
# 2

I haven't tried getting the request or response objects. You can get the session object in a form using the below code

<invoke name='getHttpSession'>

<ref>:display.state</ref>

</invoke>

You can then call session.getAttribute / session.setAttribute

chits98 at 2007-7-6 23:02:48 > top of Java-index,Web & Directory Servers,Directory Servers...
# 3
Hi,The variable " :display.state" does not seem to be available to forms. I tried to retrieve the HTTPSession object using your code but the value of ":display.state" was coming out to be null.- mangb
mangb at 2007-7-6 23:02:48 > top of Java-index,Web & Directory Servers,Directory Servers...
# 4

I would like to do this as well. I am writing a custom workflow, that will manipulate a single person. In order to get the person's view, I need to know there ID so I can check it out in the form. I want to be able to utilize the Find User form/workflow, so I added a new button to the Find User Results Form. I used a custom command (the name of my workflow). This works good, the Find User Results Form magic forwards me to the launchTask.jsp with my custom command as the workflow name. The workflow launches and I am presented with my form. The problem, is that the IDs that might have been selected on the Find User Results Form, are stored in the HTTP session. I need to retrieve them so I can find and edit the appropriate user.

Did anyone figure this out?

JimBeard at 2007-7-6 23:02:48 > top of Java-index,Web & Directory Servers,Directory Servers...
# 5
The code snippet provided by chits88 will only work in certain areas of form evaluation. If memory serves it is in <Property> and <Expansion> tags.
punk at 2007-7-6 23:02:48 > top of Java-index,Web & Directory Servers,Directory Servers...
# 6
I found a better answer to what I was trying to do. I started looking at the form through the debugger, and realized the values I want are also being passed in the form_inputs variable (view). So I could snag them just by getting them from form_inputs.
JimBeard at 2007-7-6 23:02:48 > top of Java-index,Web & Directory Servers,Directory Servers...