• Post Reply Bookmark Topic Watch Topic
  • New Topic

what/how to do (if above contains shopping cart items of type OrderPlantItem and total vars), set it

 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp:useBean id="AddChoosePlant" scope="session" class="beans.OrderTotals" /> // for shopping cart items/totals

what/how to do (if above contains shopping cart items of type OrderPlantItem and total vars), set it to null, so cart become empty...?
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our JSP forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cannot parse either your subject or post to make any sense out of it. Please try again in clearer language.
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THIS IS LIKE A SESSION VAR ? HOW set it to null, if this bean contains vars and other objs(of type bean=line item) ?

session beans are identical to session vars?

I am tring empty a shopping cart... is you meet this problem in Java/jsp, how you act?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, you just want to remove a session scoped variable? Use the <c:remove> tag from a JSP, or the removeAttribute() method from a servlet.

And, please KeepItDown
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
session.removeAttribute(AddChoosePlant); // is it correct for a JSP?

how with removeAttribute() ...? this and every session bean considered attribute/var?

is needed call the
<jsp:useBean id="AddChoosePlant" scope="session" class="beans.OrderTotals" />
and after call removeAttribute() (how?)
in the same emptycart.jsp page? // I have called <jsp:useBean in prior page...>
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leonidas Savvides wrote:session.removeAttribute(AddChoosePlant); // is it correct for a JSP?

No. There should never be any Java code in a JSP.

 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, as you say no scriptlets in jsp, so I must use tag libraries or...how the removeAttribute applies in bean method may???
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leonidas Savvides wrote:So, as you say no scriptlets in jsp, so I must use tag libraries or...how the removeAttribute applies in bean method may???


Why you don't check at your servlet/action and remove there instead removing at the jsp?

"It will be like OO likes."

C ya! [=
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!