• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...?
 
Sheriff
Posts: 22787
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to our JSP forum.
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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???
 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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! [=
 
reply
    Bookmark Topic Watch Topic
  • New Topic