Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • 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


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a servlet question. Moved to the Java beginner forum.
 
Henry Wong
author
Marshal
Pie
Posts: 21507
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
in my case then, how make cart empty?
please tell about and the 2nd ajax[server side] Q...?
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • 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 ...
 
Campbell Ritchie
Sheriff
Pie
Posts: 50251
79
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
no, what empty method normally do?

ajax forum where is? in webservices forum?
 
Campbell Ritchie
Sheriff
Pie
Posts: 50251
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leonidas Savvides wrote:no, what empty method normally do?
Empty the cart?
 
Campbell Ritchie
Sheriff
Pie
Posts: 50251
79
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Pie
Posts: 50251
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are writing the class; you decide how to empty it.
 
Henry Wong
author
Marshal
Pie
Posts: 21507
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Pie
Posts: 50251
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, Henry. I hadn't noticed the duplicate post.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic