You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by su2 <sh...@pexsupply.com> on 2009/10/06 20:48:58 UTC

How to get session variable value in Java Method?

Hello Friends,

I was trying to retrieve the session value using following code in Java
Method. But it gives me error -"session" can not be resolved.

-------------------------------------------------------------
String fromDate = session.getAttribute("fromDate");
-------------------------------------------------------------

Am I missing something?

Thank you for the help in advance.

Su-

-- 
View this message in context: http://www.nabble.com/How-to-get-session-variable-value-in-Java-Method--tp25774516p25774516.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How to get session variable value in Java Method?

Posted by su2 <sh...@pexsupply.com>.
Hi Pattrick,

I tried your suggestion, and it gives error- "request" cannot be resolved.

I am not sure what I am missing.

Thank you.
Su-



Patrick Antivackis wrote:
> 
> May  be using this can help :
> HttpSession session = ((HttpServletRequest) request).getSession();
> 
> 2009/10/6 su2 <sh...@pexsupply.com>
> 
>>
>> Hello Friends,
>>
>> I was trying to retrieve the session value using following code in Java
>> Method. But it gives me error -"session" can not be resolved.
>>
>> -------------------------------------------------------------
>> String fromDate = session.getAttribute("fromDate");
>> -------------------------------------------------------------
>>
>> Am I missing something?
>>
>> Thank you for the help in advance.
>>
>> Su-
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-get-session-variable-value-in-Java-Method--tp25774516p25774516.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-session-variable-value-in-Java-Method--tp25774516p25775771.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How to get session variable value in Java Method?

Posted by Patrick Antivackis <pa...@gmail.com>.
May  be using this can help :
HttpSession session = ((HttpServletRequest) request).getSession();

2009/10/6 su2 <sh...@pexsupply.com>

>
> Hello Friends,
>
> I was trying to retrieve the session value using following code in Java
> Method. But it gives me error -"session" can not be resolved.
>
> -------------------------------------------------------------
> String fromDate = session.getAttribute("fromDate");
> -------------------------------------------------------------
>
> Am I missing something?
>
> Thank you for the help in advance.
>
> Su-
>
> --
> View this message in context:
> http://www.nabble.com/How-to-get-session-variable-value-in-Java-Method--tp25774516p25774516.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>

Re: How to get session variable value in Java Method?

Posted by su2 <sh...@pexsupply.com>.
I tried 

      <field name="fromDate" title="date">
        	<display description="${fromDate}"/>
        </field>

and

      <field name="fromDate" title="date">
        	<display/>
        </field>

But neither of them worked.

Adrian Crum wrote:
> 
> Use a display field.
> 
> -Adrian
> 
> su2 wrote:
>> I followed your suggestion and in screen I have following code.
>> 
>>  <actions>
>>     <set field="fromDate" from-field"parameters.fromDate"/>
>>     <set field="thruDate" from-field"parameters.thruDate"/>
>>  </actions>
>> 
>> Now I want to print the user selected fromDate and thruDate in my Form.
>> 
>> Thank you.
>> Su-
>> 
>> 
>> Adrian Crum wrote:
>>> You need to include some code. I can't answer if I don't know what 
>>> you're doing.
>>>
>>> -Adrian
>>>
>>> su2 wrote:
>>>> Hi Adrian,
>>>>
>>>> How can I access fromDate and thruDate in Form xml? I tried using
>>>> fromDate
>>>> but did not work.
>>>>
>>>> Thanks for your help.
>>>> Su-
>>>>
>>>>
>>>>
>>>> Adrian Crum wrote:
>>>>> In the screen xml:
>>>>>
>>>>> <actions>
>>>>>    <set field="fromDate" from-field"parameters.fromDate"/>
>>>>>    <set field="thruDate" from-field"parameters.thruDate"/>
>>>>> </actions>
>>>>>
>>>>> In the form xml:
>>>>>
>>>>> <actions>
>>>>>    <!-- Do something with fromDate and thruDate -->
>>>>>    ...
>>>>> </actions>
>>>>>
>>>>> -Adrian
>>>>>
>>>>> su2 wrote:
>>>>>> Sorry, I was not able to understand - keep the information in the
>>>>>> context.
>>>>>> Can you please explain in detail.
>>>>>>
>>>>>> I really appreciate your help.
>>>>>>
>>>>>> Thank you.
>>>>>> Su-
>>>>>>
>>>>>>
>>>>>> Adrian Crum wrote:
>>>>>>> Why not keep that information in the context? Trying to access
>>>>>>> session 
>>>>>>> information in the presentation layer breaks the MVC boundaries.
>>>>>>>
>>>>>>> -Adrian
>>>>>>>
>>>>>>> su2 wrote:
>>>>>>>> Hi Adrian,
>>>>>>>>
>>>>>>>> I have a screen which has bsh file in <actions> and FormWidget in
>>>>>>>> <widgets>
>>>>>>>> tag. I am capturing fromDate and thruDate in Session in .bsh file.
>>>>>>>>
>>>>>>>> Now from FormWidget I am calling Java Methods for the data
>>>>>>>> manipulation.
>>>>>>>> For
>>>>>>>> the data manipulation I need to have access to fromDate and
>>>>>>>> thruDate
>>>>>>>> selected by the user.
>>>>>>>>
>>>>>>>> So here in Java method I am trying to access session variables.
>>>>>>>>
>>>>>>>> I hope it helps in understanding my scenario.
>>>>>>>>
>>>>>>>> Thank you.
>>>>>>>> Su-
>>>>>>>>
>>>>>>>> Adrian Crum wrote:
>>>>>>>>> You haven't provided enough information. Where in the program flow
>>>>>>>>> is 
>>>>>>>>> the Java method? What are you trying to retrieve? What are you
>>>>>>>>> trying
>>>>>>>>> to 
>>>>>>>>> achieve?
>>>>>>>>>
>>>>>>>>> -Adrian
>>>>>>>>>
>>>>>>>>> su2 wrote:
>>>>>>>>>> Hello Friends,
>>>>>>>>>>
>>>>>>>>>> I was trying to retrieve the session value using following code
>>>>>>>>>> in
>>>>>>>>>> Java
>>>>>>>>>> Method. But it gives me error -"session" can not be resolved.
>>>>>>>>>>
>>>>>>>>>> -------------------------------------------------------------
>>>>>>>>>> String fromDate = session.getAttribute("fromDate");
>>>>>>>>>> -------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> Am I missing something?
>>>>>>>>>>
>>>>>>>>>> Thank you for the help in advance.
>>>>>>>>>>
>>>>>>>>>> Su-
>>>>>>>>>>
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-session-variable-value-in-Java-Method--tp25774516p25794928.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How to get session variable value in Java Method?

Posted by Adrian Crum <ad...@hlmksw.com>.
Use a display field.

-Adrian

su2 wrote:
> I followed your suggestion and in screen I have following code.
> 
>  <actions>
>     <set field="fromDate" from-field"parameters.fromDate"/>
>     <set field="thruDate" from-field"parameters.thruDate"/>
>  </actions>
> 
> Now I want to print the user selected fromDate and thruDate in my Form.
> 
> Thank you.
> Su-
> 
> 
> Adrian Crum wrote:
>> You need to include some code. I can't answer if I don't know what 
>> you're doing.
>>
>> -Adrian
>>
>> su2 wrote:
>>> Hi Adrian,
>>>
>>> How can I access fromDate and thruDate in Form xml? I tried using
>>> fromDate
>>> but did not work.
>>>
>>> Thanks for your help.
>>> Su-
>>>
>>>
>>>
>>> Adrian Crum wrote:
>>>> In the screen xml:
>>>>
>>>> <actions>
>>>>    <set field="fromDate" from-field"parameters.fromDate"/>
>>>>    <set field="thruDate" from-field"parameters.thruDate"/>
>>>> </actions>
>>>>
>>>> In the form xml:
>>>>
>>>> <actions>
>>>>    <!-- Do something with fromDate and thruDate -->
>>>>    ...
>>>> </actions>
>>>>
>>>> -Adrian
>>>>
>>>> su2 wrote:
>>>>> Sorry, I was not able to understand - keep the information in the
>>>>> context.
>>>>> Can you please explain in detail.
>>>>>
>>>>> I really appreciate your help.
>>>>>
>>>>> Thank you.
>>>>> Su-
>>>>>
>>>>>
>>>>> Adrian Crum wrote:
>>>>>> Why not keep that information in the context? Trying to access session 
>>>>>> information in the presentation layer breaks the MVC boundaries.
>>>>>>
>>>>>> -Adrian
>>>>>>
>>>>>> su2 wrote:
>>>>>>> Hi Adrian,
>>>>>>>
>>>>>>> I have a screen which has bsh file in <actions> and FormWidget in
>>>>>>> <widgets>
>>>>>>> tag. I am capturing fromDate and thruDate in Session in .bsh file.
>>>>>>>
>>>>>>> Now from FormWidget I am calling Java Methods for the data
>>>>>>> manipulation.
>>>>>>> For
>>>>>>> the data manipulation I need to have access to fromDate and thruDate
>>>>>>> selected by the user.
>>>>>>>
>>>>>>> So here in Java method I am trying to access session variables.
>>>>>>>
>>>>>>> I hope it helps in understanding my scenario.
>>>>>>>
>>>>>>> Thank you.
>>>>>>> Su-
>>>>>>>
>>>>>>> Adrian Crum wrote:
>>>>>>>> You haven't provided enough information. Where in the program flow
>>>>>>>> is 
>>>>>>>> the Java method? What are you trying to retrieve? What are you
>>>>>>>> trying
>>>>>>>> to 
>>>>>>>> achieve?
>>>>>>>>
>>>>>>>> -Adrian
>>>>>>>>
>>>>>>>> su2 wrote:
>>>>>>>>> Hello Friends,
>>>>>>>>>
>>>>>>>>> I was trying to retrieve the session value using following code in
>>>>>>>>> Java
>>>>>>>>> Method. But it gives me error -"session" can not be resolved.
>>>>>>>>>
>>>>>>>>> -------------------------------------------------------------
>>>>>>>>> String fromDate = session.getAttribute("fromDate");
>>>>>>>>> -------------------------------------------------------------
>>>>>>>>>
>>>>>>>>> Am I missing something?
>>>>>>>>>
>>>>>>>>> Thank you for the help in advance.
>>>>>>>>>
>>>>>>>>> Su-
>>>>>>>>>
>>
> 

Re: How to get session variable value in Java Method?

Posted by su2 <sh...@pexsupply.com>.
I followed your suggestion and in screen I have following code.

 <actions>
    <set field="fromDate" from-field"parameters.fromDate"/>
    <set field="thruDate" from-field"parameters.thruDate"/>
 </actions>

Now I want to print the user selected fromDate and thruDate in my Form.

Thank you.
Su-


Adrian Crum wrote:
> 
> You need to include some code. I can't answer if I don't know what 
> you're doing.
> 
> -Adrian
> 
> su2 wrote:
>> Hi Adrian,
>> 
>> How can I access fromDate and thruDate in Form xml? I tried using
>> fromDate
>> but did not work.
>> 
>> Thanks for your help.
>> Su-
>> 
>> 
>> 
>> Adrian Crum wrote:
>>> In the screen xml:
>>>
>>> <actions>
>>>    <set field="fromDate" from-field"parameters.fromDate"/>
>>>    <set field="thruDate" from-field"parameters.thruDate"/>
>>> </actions>
>>>
>>> In the form xml:
>>>
>>> <actions>
>>>    <!-- Do something with fromDate and thruDate -->
>>>    ...
>>> </actions>
>>>
>>> -Adrian
>>>
>>> su2 wrote:
>>>> Sorry, I was not able to understand - keep the information in the
>>>> context.
>>>> Can you please explain in detail.
>>>>
>>>> I really appreciate your help.
>>>>
>>>> Thank you.
>>>> Su-
>>>>
>>>>
>>>> Adrian Crum wrote:
>>>>> Why not keep that information in the context? Trying to access session 
>>>>> information in the presentation layer breaks the MVC boundaries.
>>>>>
>>>>> -Adrian
>>>>>
>>>>> su2 wrote:
>>>>>> Hi Adrian,
>>>>>>
>>>>>> I have a screen which has bsh file in <actions> and FormWidget in
>>>>>> <widgets>
>>>>>> tag. I am capturing fromDate and thruDate in Session in .bsh file.
>>>>>>
>>>>>> Now from FormWidget I am calling Java Methods for the data
>>>>>> manipulation.
>>>>>> For
>>>>>> the data manipulation I need to have access to fromDate and thruDate
>>>>>> selected by the user.
>>>>>>
>>>>>> So here in Java method I am trying to access session variables.
>>>>>>
>>>>>> I hope it helps in understanding my scenario.
>>>>>>
>>>>>> Thank you.
>>>>>> Su-
>>>>>>
>>>>>> Adrian Crum wrote:
>>>>>>> You haven't provided enough information. Where in the program flow
>>>>>>> is 
>>>>>>> the Java method? What are you trying to retrieve? What are you
>>>>>>> trying
>>>>>>> to 
>>>>>>> achieve?
>>>>>>>
>>>>>>> -Adrian
>>>>>>>
>>>>>>> su2 wrote:
>>>>>>>> Hello Friends,
>>>>>>>>
>>>>>>>> I was trying to retrieve the session value using following code in
>>>>>>>> Java
>>>>>>>> Method. But it gives me error -"session" can not be resolved.
>>>>>>>>
>>>>>>>> -------------------------------------------------------------
>>>>>>>> String fromDate = session.getAttribute("fromDate");
>>>>>>>> -------------------------------------------------------------
>>>>>>>>
>>>>>>>> Am I missing something?
>>>>>>>>
>>>>>>>> Thank you for the help in advance.
>>>>>>>>
>>>>>>>> Su-
>>>>>>>>
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-session-variable-value-in-Java-Method--tp25774516p25794665.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How to get session variable value in Java Method?

Posted by Adrian Crum <ad...@hlmksw.com>.
You need to include some code. I can't answer if I don't know what 
you're doing.

-Adrian

su2 wrote:
> Hi Adrian,
> 
> How can I access fromDate and thruDate in Form xml? I tried using fromDate
> but did not work.
> 
> Thanks for your help.
> Su-
> 
> 
> 
> Adrian Crum wrote:
>> In the screen xml:
>>
>> <actions>
>>    <set field="fromDate" from-field"parameters.fromDate"/>
>>    <set field="thruDate" from-field"parameters.thruDate"/>
>> </actions>
>>
>> In the form xml:
>>
>> <actions>
>>    <!-- Do something with fromDate and thruDate -->
>>    ...
>> </actions>
>>
>> -Adrian
>>
>> su2 wrote:
>>> Sorry, I was not able to understand - keep the information in the
>>> context.
>>> Can you please explain in detail.
>>>
>>> I really appreciate your help.
>>>
>>> Thank you.
>>> Su-
>>>
>>>
>>> Adrian Crum wrote:
>>>> Why not keep that information in the context? Trying to access session 
>>>> information in the presentation layer breaks the MVC boundaries.
>>>>
>>>> -Adrian
>>>>
>>>> su2 wrote:
>>>>> Hi Adrian,
>>>>>
>>>>> I have a screen which has bsh file in <actions> and FormWidget in
>>>>> <widgets>
>>>>> tag. I am capturing fromDate and thruDate in Session in .bsh file.
>>>>>
>>>>> Now from FormWidget I am calling Java Methods for the data
>>>>> manipulation.
>>>>> For
>>>>> the data manipulation I need to have access to fromDate and thruDate
>>>>> selected by the user.
>>>>>
>>>>> So here in Java method I am trying to access session variables.
>>>>>
>>>>> I hope it helps in understanding my scenario.
>>>>>
>>>>> Thank you.
>>>>> Su-
>>>>>
>>>>> Adrian Crum wrote:
>>>>>> You haven't provided enough information. Where in the program flow is 
>>>>>> the Java method? What are you trying to retrieve? What are you trying
>>>>>> to 
>>>>>> achieve?
>>>>>>
>>>>>> -Adrian
>>>>>>
>>>>>> su2 wrote:
>>>>>>> Hello Friends,
>>>>>>>
>>>>>>> I was trying to retrieve the session value using following code in
>>>>>>> Java
>>>>>>> Method. But it gives me error -"session" can not be resolved.
>>>>>>>
>>>>>>> -------------------------------------------------------------
>>>>>>> String fromDate = session.getAttribute("fromDate");
>>>>>>> -------------------------------------------------------------
>>>>>>>
>>>>>>> Am I missing something?
>>>>>>>
>>>>>>> Thank you for the help in advance.
>>>>>>>
>>>>>>> Su-
>>>>>>>
>>
> 

Re: How to get session variable value in Java Method?

Posted by su2 <sh...@pexsupply.com>.
Hi Adrian,

How can I access fromDate and thruDate in Form xml? I tried using fromDate
but did not work.

Thanks for your help.
Su-



Adrian Crum wrote:
> 
> In the screen xml:
> 
> <actions>
>    <set field="fromDate" from-field"parameters.fromDate"/>
>    <set field="thruDate" from-field"parameters.thruDate"/>
> </actions>
> 
> In the form xml:
> 
> <actions>
>    <!-- Do something with fromDate and thruDate -->
>    ...
> </actions>
> 
> -Adrian
> 
> su2 wrote:
>> Sorry, I was not able to understand - keep the information in the
>> context.
>> Can you please explain in detail.
>> 
>> I really appreciate your help.
>> 
>> Thank you.
>> Su-
>> 
>> 
>> Adrian Crum wrote:
>>> Why not keep that information in the context? Trying to access session 
>>> information in the presentation layer breaks the MVC boundaries.
>>>
>>> -Adrian
>>>
>>> su2 wrote:
>>>> Hi Adrian,
>>>>
>>>> I have a screen which has bsh file in <actions> and FormWidget in
>>>> <widgets>
>>>> tag. I am capturing fromDate and thruDate in Session in .bsh file.
>>>>
>>>> Now from FormWidget I am calling Java Methods for the data
>>>> manipulation.
>>>> For
>>>> the data manipulation I need to have access to fromDate and thruDate
>>>> selected by the user.
>>>>
>>>> So here in Java method I am trying to access session variables.
>>>>
>>>> I hope it helps in understanding my scenario.
>>>>
>>>> Thank you.
>>>> Su-
>>>>
>>>> Adrian Crum wrote:
>>>>> You haven't provided enough information. Where in the program flow is 
>>>>> the Java method? What are you trying to retrieve? What are you trying
>>>>> to 
>>>>> achieve?
>>>>>
>>>>> -Adrian
>>>>>
>>>>> su2 wrote:
>>>>>> Hello Friends,
>>>>>>
>>>>>> I was trying to retrieve the session value using following code in
>>>>>> Java
>>>>>> Method. But it gives me error -"session" can not be resolved.
>>>>>>
>>>>>> -------------------------------------------------------------
>>>>>> String fromDate = session.getAttribute("fromDate");
>>>>>> -------------------------------------------------------------
>>>>>>
>>>>>> Am I missing something?
>>>>>>
>>>>>> Thank you for the help in advance.
>>>>>>
>>>>>> Su-
>>>>>>
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-session-variable-value-in-Java-Method--tp25774516p25793935.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How to get session variable value in Java Method?

Posted by Adrian Crum <ad...@hlmksw.com>.
In the screen xml:

<actions>
   <set field="fromDate" from-field"parameters.fromDate"/>
   <set field="thruDate" from-field"parameters.thruDate"/>
</actions>

In the form xml:

<actions>
   <!-- Do something with fromDate and thruDate -->
   ...
</actions>

-Adrian

su2 wrote:
> Sorry, I was not able to understand - keep the information in the context.
> Can you please explain in detail.
> 
> I really appreciate your help.
> 
> Thank you.
> Su-
> 
> 
> Adrian Crum wrote:
>> Why not keep that information in the context? Trying to access session 
>> information in the presentation layer breaks the MVC boundaries.
>>
>> -Adrian
>>
>> su2 wrote:
>>> Hi Adrian,
>>>
>>> I have a screen which has bsh file in <actions> and FormWidget in
>>> <widgets>
>>> tag. I am capturing fromDate and thruDate in Session in .bsh file.
>>>
>>> Now from FormWidget I am calling Java Methods for the data manipulation.
>>> For
>>> the data manipulation I need to have access to fromDate and thruDate
>>> selected by the user.
>>>
>>> So here in Java method I am trying to access session variables.
>>>
>>> I hope it helps in understanding my scenario.
>>>
>>> Thank you.
>>> Su-
>>>
>>> Adrian Crum wrote:
>>>> You haven't provided enough information. Where in the program flow is 
>>>> the Java method? What are you trying to retrieve? What are you trying to 
>>>> achieve?
>>>>
>>>> -Adrian
>>>>
>>>> su2 wrote:
>>>>> Hello Friends,
>>>>>
>>>>> I was trying to retrieve the session value using following code in Java
>>>>> Method. But it gives me error -"session" can not be resolved.
>>>>>
>>>>> -------------------------------------------------------------
>>>>> String fromDate = session.getAttribute("fromDate");
>>>>> -------------------------------------------------------------
>>>>>
>>>>> Am I missing something?
>>>>>
>>>>> Thank you for the help in advance.
>>>>>
>>>>> Su-
>>>>>
>>
> 

Re: How to get session variable value in Java Method?

Posted by su2 <sh...@pexsupply.com>.
Sorry, I was not able to understand - keep the information in the context.
Can you please explain in detail.

I really appreciate your help.

Thank you.
Su-


Adrian Crum wrote:
> 
> Why not keep that information in the context? Trying to access session 
> information in the presentation layer breaks the MVC boundaries.
> 
> -Adrian
> 
> su2 wrote:
>> Hi Adrian,
>> 
>> I have a screen which has bsh file in <actions> and FormWidget in
>> <widgets>
>> tag. I am capturing fromDate and thruDate in Session in .bsh file.
>> 
>> Now from FormWidget I am calling Java Methods for the data manipulation.
>> For
>> the data manipulation I need to have access to fromDate and thruDate
>> selected by the user.
>> 
>> So here in Java method I am trying to access session variables.
>> 
>> I hope it helps in understanding my scenario.
>> 
>> Thank you.
>> Su-
>> 
>> Adrian Crum wrote:
>>> You haven't provided enough information. Where in the program flow is 
>>> the Java method? What are you trying to retrieve? What are you trying to 
>>> achieve?
>>>
>>> -Adrian
>>>
>>> su2 wrote:
>>>> Hello Friends,
>>>>
>>>> I was trying to retrieve the session value using following code in Java
>>>> Method. But it gives me error -"session" can not be resolved.
>>>>
>>>> -------------------------------------------------------------
>>>> String fromDate = session.getAttribute("fromDate");
>>>> -------------------------------------------------------------
>>>>
>>>> Am I missing something?
>>>>
>>>> Thank you for the help in advance.
>>>>
>>>> Su-
>>>>
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-session-variable-value-in-Java-Method--tp25774516p25776447.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How to get session variable value in Java Method?

Posted by Adrian Crum <ad...@hlmksw.com>.
Why not keep that information in the context? Trying to access session 
information in the presentation layer breaks the MVC boundaries.

-Adrian

su2 wrote:
> Hi Adrian,
> 
> I have a screen which has bsh file in <actions> and FormWidget in <widgets>
> tag. I am capturing fromDate and thruDate in Session in .bsh file.
> 
> Now from FormWidget I am calling Java Methods for the data manipulation. For
> the data manipulation I need to have access to fromDate and thruDate
> selected by the user.
> 
> So here in Java method I am trying to access session variables.
> 
> I hope it helps in understanding my scenario.
> 
> Thank you.
> Su-
> 
> Adrian Crum wrote:
>> You haven't provided enough information. Where in the program flow is 
>> the Java method? What are you trying to retrieve? What are you trying to 
>> achieve?
>>
>> -Adrian
>>
>> su2 wrote:
>>> Hello Friends,
>>>
>>> I was trying to retrieve the session value using following code in Java
>>> Method. But it gives me error -"session" can not be resolved.
>>>
>>> -------------------------------------------------------------
>>> String fromDate = session.getAttribute("fromDate");
>>> -------------------------------------------------------------
>>>
>>> Am I missing something?
>>>
>>> Thank you for the help in advance.
>>>
>>> Su-
>>>
>>
> 

Re: How to get session variable value in Java Method?

Posted by su2 <sh...@pexsupply.com>.
Hi Adrian,

I have a screen which has bsh file in <actions> and FormWidget in <widgets>
tag. I am capturing fromDate and thruDate in Session in .bsh file.

Now from FormWidget I am calling Java Methods for the data manipulation. For
the data manipulation I need to have access to fromDate and thruDate
selected by the user.

So here in Java method I am trying to access session variables.

I hope it helps in understanding my scenario.

Thank you.
Su-

Adrian Crum wrote:
> 
> You haven't provided enough information. Where in the program flow is 
> the Java method? What are you trying to retrieve? What are you trying to 
> achieve?
> 
> -Adrian
> 
> su2 wrote:
>> Hello Friends,
>> 
>> I was trying to retrieve the session value using following code in Java
>> Method. But it gives me error -"session" can not be resolved.
>> 
>> -------------------------------------------------------------
>> String fromDate = session.getAttribute("fromDate");
>> -------------------------------------------------------------
>> 
>> Am I missing something?
>> 
>> Thank you for the help in advance.
>> 
>> Su-
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-session-variable-value-in-Java-Method--tp25774516p25776086.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How to get session variable value in Java Method?

Posted by Adrian Crum <ad...@hlmksw.com>.
You haven't provided enough information. Where in the program flow is 
the Java method? What are you trying to retrieve? What are you trying to 
achieve?

-Adrian

su2 wrote:
> Hello Friends,
> 
> I was trying to retrieve the session value using following code in Java
> Method. But it gives me error -"session" can not be resolved.
> 
> -------------------------------------------------------------
> String fromDate = session.getAttribute("fromDate");
> -------------------------------------------------------------
> 
> Am I missing something?
> 
> Thank you for the help in advance.
> 
> Su-
>