problem using session.getAttribute("userLogin")

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

problem using session.getAttribute("userLogin")

Abhishake Agarwal-2
Hello,

I am getting following error if I try to get userLogin from session in
orderStatus.bsh. please let me know what might be the problem.

[java] Message: Error rendering screen
[component://eshop/widget/EmailOrderScreens.xml#OrderCompleteNotice]:
org.ofbiz.base.util.GeneralException: Error running BSH script at location
[component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh]
(Error running BSH script at
[component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh],
line [40]: Sourced file:
component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
: Attempt to resolve method: getAttribute() on undefined variable or class
name: session : at Line: 40 : in file:
component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
: session .getAttribute ( "userLogin" )
     [java]  (Sourced file:
component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
:* Attempt to resolve method: getAttribute() on undefined variable or class
name: session))*
     [java] ---- stack trace
---------------------------------------------------------------
     [java] java.lang.Exception: Error rendering screen
[component://eshop/widget/EmailOrderScreens.xml#OrderCompleteNotice]:
org.ofbiz.base.util.GeneralException: Error running BSH script at location
[component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh]
(Error running BSH script at
[component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh],
line [40]: Sourced file:
component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
: Attempt to resolve method: getAttribute() on undefined variable or class
name: session : at Line: 40 : in file:
component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
: session .getAttribute ( "userLogin" )
     [java]  (Sourced file:
component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
: Attempt to resolve method: getAttribute() on undefined variable or class
name: session))

Regards,
Abhishake
Reply | Threaded
Open this post in threaded view
|

Re: problem using session.getAttribute("userLogin")

Jacques Le Roux
Administrator
Please use rather user ML for such questions :
http://docs.ofbiz.org/display/OFBADMIN/Mailing+Lists#MailingLists-DeveloperList:dev@...

Looks like you did not define a session var. You might try something like
session = request.getSession();

Don't forget the import
import javax.servlet.http.*;

Jacques


From: "Abhishake Agarwal" <[hidden email]>

> Hello,
>
> I am getting following error if I try to get userLogin from session in
> orderStatus.bsh. please let me know what might be the problem.
>
> [java] Message: Error rendering screen
> [component://eshop/widget/EmailOrderScreens.xml#OrderCompleteNotice]:
> org.ofbiz.base.util.GeneralException: Error running BSH script at location
> [component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh]
> (Error running BSH script at
> [component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh],
> line [40]: Sourced file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> : Attempt to resolve method: getAttribute() on undefined variable or class
> name: session : at Line: 40 : in file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> : session .getAttribute ( "userLogin" )
>     [java]  (Sourced file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> :* Attempt to resolve method: getAttribute() on undefined variable or class
> name: session))*
>     [java] ---- stack trace
> ---------------------------------------------------------------
>     [java] java.lang.Exception: Error rendering screen
> [component://eshop/widget/EmailOrderScreens.xml#OrderCompleteNotice]:
> org.ofbiz.base.util.GeneralException: Error running BSH script at location
> [component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh]
> (Error running BSH script at
> [component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh],
> line [40]: Sourced file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> : Attempt to resolve method: getAttribute() on undefined variable or class
> name: session : at Line: 40 : in file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> : session .getAttribute ( "userLogin" )
>     [java]  (Sourced file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> : Attempt to resolve method: getAttribute() on undefined variable or class
> name: session))
>
> Regards,
> Abhishake
>
Reply | Threaded
Open this post in threaded view
|

Re: problem using session.getAttribute("userLogin")

Abhishake Agarwal
In reply to this post by Abhishake Agarwal-2
Just brief description why I am trying getting userLogin from session:

when I click on *quick Entire shipping* for a order created using *anonymous
checkout*, the order completion mail sent to user contain a message

 *Order Complete Notice*

*NOTE: This is a DEMO store-front. Orders placed here will NOT be billed,
and will NOT be fulfilled.*
*Order not found with ID [IBGO10062], or not allowed to view.*when I further
investigated this, I found userLogin variable used in orderStatus.bsh is
null. also session and request variable is void. please let me know how can
I get userLogin in orderStatus.bsh when order is created using anonymous
checkout(when I click on quick ship entire order).




Regards,
Abhishake


On Sun, Mar 9, 2008 at 4:49 PM, Abhishake Agarwal <[hidden email]>
wrote:

> Hello,
>
> I am getting following error if I try to get userLogin from session in
> orderStatus.bsh. please let me know what might be the problem.
>
> [java] Message: Error rendering screen
> [component://eshop/widget/EmailOrderScreens.xml#OrderCompleteNotice]:
> org.ofbiz.base.util.GeneralException: Error running BSH script at location
> [component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh]
> (Error running BSH script at
> [component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh],
> line [40]: Sourced file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> : Attempt to resolve method: getAttribute() on undefined variable or class
> name: session : at Line: 40 : in file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> : session .getAttribute ( "userLogin" )
>      [java]  (Sourced file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> :* Attempt to resolve method: getAttribute() on undefined variable or
> class name: session))*
>      [java] ---- stack trace
> ---------------------------------------------------------------
>      [java] java.lang.Exception: Error rendering screen
> [component://eshop/widget/EmailOrderScreens.xml#OrderCompleteNotice]:
> org.ofbiz.base.util.GeneralException: Error running BSH script at location
> [component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh]
> (Error running BSH script at
> [component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh],
> line [40]: Sourced file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> : Attempt to resolve method: getAttribute() on undefined variable or class
> name: session : at Line: 40 : in file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> : session .getAttribute ( "userLogin" )
>      [java]  (Sourced file:
> component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh
> : Attempt to resolve method: getAttribute() on undefined variable or class
> name: session))
>
> Regards,
> Abhishake
>