mike hengst

Ranch Hand
+ Follow
since Oct 19, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by mike hengst

PS this happens after I fill out the login.jsp with username and password and then press the submit button which calls the servlet.......
21 years ago
What is the most common cause for this error:
Error. The file was not found. (servlet name = java146.project4.LogIn)
All my stuff is compiled in the right directories. A little frustrating, the answer is probably very obvious as well.. thanks
21 years ago
I have solved the problem. It is adding everybody in now. Now onto the other errors. HA they nver end.
21 years ago
This is my problem:
if LastName map contains the key of this emp's lastname
extract the value object(an arraylist) from the map and add
the current emp object reference to it
else
instantiate a new arraylist and add the emp reference to it
then add the last name key and the arraylist value object
to the map
Here is what I have so far:

The problem is that when I run into the second instance of a last name(inmy case smith) it throws a ClassCastException on this line:
((ArrayList)byLast.get(emp.getLastName())).add(emp);
What should I do??? It does seem that this is the only forum that I can get serious answers to my problems and I truly appreciate that fact. So thatnk you to anyone who can help me straighten out my code.
[ April 07, 2003: Message edited by: mike hengst ]
21 years ago
I have somewhat figured out??? However data is not displaying correctly. Can you look at this please, thank you. Here are the pertinent methods

21 years ago
Hows this:
It still does not work???
21 years ago
Here is an updated code version, same error:
21 years ago
When I run my client server project I am getting a ClassCastException error??? My method finds an employee by the ID, Here are the specs I am to use.
variables
ArrayList emps;
Employee emp; I have an Employee class
Test the map for the passed key
if found
set the emps var to the arraylist found by doing a get on the byId map using the passed arg
extract the one employee outof the map using the map's get(0) method
execute the employees toString() to represent this emp as a string and return the stringto the protocol
otherwise return string that says not found

here is the code:

21 years ago
Here is the code I have working:


21 years ago
I posted my server and thread classes so you could see where I was sending the input from the client. out is my printwriter and outputs to the server the user input. The problem is once the client displays a menu it is supposed to accept user inputs such as 1 or 2 or 3 etc and sends that to the server to retrieve a file etc... Instead the cursor just sits there.???
21 years ago
I am not sure this is the right forum to ask my question but here goes. I am trying to write this application that calls for a client and a server along with other classes which I have not got to yet. Here is the problem: The client won't accept input. I had it working at one point but had to fix a bug and now it does not accept user input. If someone could just take a look at my code and tell me where my error is I would appreciate it greatly. Here are the client and server classes:


21 years ago
I see what you are saying about HashMap. We had to use that in another part of our project. For the class I am working on we are required to use HashSet. The reason being is we want to find the total number of unique tokens. HashSet will no store a tok if it already in the set, correct? I am not even sure that I need to use the iterator.
So i understand the concept of what I need to do just not how to actually do it. I have looked at the api's. They do a good job of explaining the classes but not with any example. Thanks for responding.
22 years ago
I am working on a project and am wondering if anyone can give me some help. I am supposed to use a HashSet to get the unique count of tokens from a file. So far I am not getting a count. How does one iterate through a HashSet and add tokens?
Here is my method that I have developed so far.


Any help and/or discussion is appreciated.
22 years ago
Everything worked out pretty good at the end. The reason I did not post my question the file io forum is because I did not realize that there was such a thing until after I had been posting to this forum. Usually I just head right here or to the beginner forum so I never paused to look to see if there were a file io area. Sorry if this caused a problem.....
I hope you were able to finish up your shopping, I still have some left to go, and am not looking forward to the evil crowds....hahaha
22 years ago
Ok I have worked this to being pretty colse to what I need. The only problem left(Ihope) is that not everything I want to be outputted to the orderout file is showing up. The data must be being passed to the super class because the output I am getting hs been calculated, which is done in the super class(Order). I am only getting the extended price with the handling charge added on. What am I not doing that is causing this???HELP. Here is the code for the two classes in question. I think it may have to do with the toString() itself and will keep working on it, bu tI would appreciate a second(or more) set of eyes to look at it...Thanks
22 years ago