Matt Read

Greenhorn
+ Follow
since Jul 27, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Matt Read

The .put() method of Map takes a key and value as parameters. Your code reads:

which means you're putting "this", i.e. the instance of your CartBean into the Map as the key.
I'm not sure I can suggest exactly what you should be doing as your CartBean class seems to be trying to be both a Cart and a CartItem.
You might want to seperate out the Cart (backed by a Map) from items that go into a Cart (seperate class with the getters and setters that you're currently defining in CartBean). The Cart class would have an addtoCart(CartItem item) method which does something like:

Or maybe I'm just misunderstanding what you're trying to do. Hope this helps.
Matt.
[ October 25, 2003: Message edited by: Matt Read ]
16 years ago
HttpRequest parameters are immutable. A possible solution, although probably not exactly what you want, would to be to use:

to set your value into the request scope and read it from your ExitAction with:

Matt.
16 years ago
With this code:
String uname="John" ;
request.setAttribute("username",uname);
In your Action you're setting a request attribute of "username" to "John". What you really want to be doing is setting a property of your ActionForm so that
<html:text property="username" readonly="true" />
returns with "John".
Try this in your Action instead:
aForm.setUsername("John");
Hope this helps.
Matt.
16 years ago
Isn't this getting confused between Stateless and Connectionless?
That aside, if these definitions have any value then it seems to me that HTTP is connection-oriented.
http://www.computeruser.com/resources/dictionary/definition.html?lookup=178
http://www.computeruser.com/resources/dictionary/definition.html?lookup=186
I hope I don't get this question in the exam...
Matt.