• 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

How assign to null an obj that contains other objs as attributes

 
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How assign to null an obj eg cart, but that includes attributes/vars eg total, totalTax... AND other objs of kind lineItem,... all these to null assign?


supposing that below provides the xml file as server to another script ajax(non shown) bookrss.xml where in netbeans must be???
the below AjaxRSSServlet.java is in:
Source Packages>default Package or
C:\Users\User\Documents\TextBooksDataFiles\JAVA\xml-java\ParsonsWebServicesAjax\src\java\AjaxRSSServlet.java


 
Sheriff
Posts: 67746
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
Not a servlet question. Moved to the Java beginner forum.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Leonidas Savvides wrote:How assign to null an obj eg cart, but that includes attributes/vars eg total, totalTax... AND other objs of kind lineItem,... all these to null assign?



Not sure what you mean by "assign to null". A null is a literal. Its not a variable. And it can't be assigned anything. You can, however, assign its value to object references though.

Henry
 
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
in my case then, how make cart empty?
please tell about and the 2nd ajax[server side] Q...?
 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I understand you correctly, you could do something like


This would assign a new, possibly empty, cart to the cart variable. The other option is to make a function that would set all the variables in a cart to null, zero ...
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why does your Cart class not have an empty() method?
 
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
no, what empty method normally do?

ajax forum where is? in webservices forum?
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Leonidas Savvides wrote:no, what empty method normally do?

Empty the cart?
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Leonidas Savvides wrote:ajax forum where is?

Try here.
 
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

Campbell Ritchie wrote:

Leonidas Savvides wrote:no, what empty method normally do?

Empty the cart?



i mean how empty it, what technic used?
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are writing the class; you decide how to empty it.
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Leonidas Savvides wrote:ajax forum where is?

Try here.



Be careful here. From the posts so far, this topic is not very closely related to ajax. And there is currently a book promotion going on in that forum.



EDIT... Anyway, it looks like you have posted there... And...

1. The topic is not an ajax topic. A server side code that happens to support a client that happens to be using ajax to make the call doesn't make it an ajax question.

2. Duplicate topic. The post is an exact post of this one. With the same vague reference to carts, but nothing in the code that shows anything related to it. And ... cross posting wastes people's time and effort.

3. Book promotion in progress.


So... the other topic was trashed. Please continue the discussion here. Please elaborate your question more -- specifically what you have been asked here.

Henry
 
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

Martin Vanyavchich wrote:If I understand you correctly, you could do something like


This would assign a new, possibly empty, cart to the cart variable. The other option is to make a function that would set all the variables in a cart to null, zero ...



if I have in JSP the
<jsp:useBean id="AddChoosePlant" scope="session" class="beans.OrderTotals" />
as cart obj that contains lineItem objs and total vars,
then how to act?
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, Henry. I hadn't noticed the duplicate post.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic