garima jain

Ranch Hand
+ Follow
since Sep 22, 2008
Merit badge: grant badges
For More
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 garima jain

thanks David
14 years ago
I am writing a small application for Online Test using struts 2.0. I wrote a custom validator class to do validation on the login screen. Following is the code for that:

If I run my application, it gives NPE on sessionMap at line no 13 . That means, struts is not initializing sessionMap variable using its setSession method. Could you please explain the reason for such behaviour.



14 years ago
Thanks for the reply. Yes I want to know how to use them. I need answer for my second question as well.

Please help.
garima
14 years ago
Hi,

I am new to Struts and I am a writing a small application for Online Test in struts 2.0. I have got three queries:

1. After successfully login into the application, if the user presses the Close button (X) on the window and then the user starts the application again, will the previous session be retained. If so, what is way to invalidate the session after the Close button is pressed so that all the variables scoped at session level are set to their initial value.

2. In my test.jsp, I have got two buttons - prev and next. In my corresponding action class method, I want to identify which of the two buttons was pressed so that counter can either be decremented or incremented depending on the button pressed.
i wrote the following code but nextprev does not seem to retain the value of the button pressed. Result of this is null is passed to the action property nextprev.


3. How do we scope classes at various levels in struts 2.0 i.e Request, Session, Page, Application.

please help. thanks in advance.



14 years ago
Hi All,

I have 5 years of experience in as400 with two reputed companies. I started my career with a company where work culture was amazing. There were challenges each day. I worked threre for almost three years. Due to personal reasons I had to change location and had to switch to this comapny where i have been working for two and half years. Since quality of work is not that good over here and i can't change my location, I thought of changing my technology so as to get into a good project in the same company. After doing rounds of discussions with seniors I studied and did lot of practice in java and took SCJP 1.6 exam and cleared it with 86%. But because of slowdown there are no internal openings. I am completly frustrated with my present work and I want to get into java asap. This will also help me diversify my skillset. Please suggest what i should do.
Any suggestion will be of great help.

Thanks,
Garima
15 years ago
I cleared SCJP 1.6 today with 86%. I had been slogging for a while and I am happy that I could do it.

All thanks to you guys especially Ankit Garg who helped clear my doubts and questions. This is indeed a great forum.

Needless to say, Kathy Sierra is great book and I would strongly recommend Devaka Cooray’s ExamLab.

Thanks again,
Garima
15 years ago
It is compiling now. I have another very basic question.

I had not written package statements in Robot, Pet and Dog class. They compiled fine but MyClass does not compile without package statements in those source files. Why are they necessary. Is it because we are using import in MyClass and to use a class in another package, we must mention package in the source file of class to be used. Please explain. I know its very basic but i want to understand it clearly.

Thanks.
Source: Kathy Sierra Master Exam

Which statement(s) must be added for the source file to compile? (Choose all that apply.)
Correct Answer
B: import org.*;
E: import org.ex.*;
F: package org.ex.why;

My question is even if we use the above statements, program should not compile as there is no way to specify path (absolut or relative) to find super directories from sub directories.

I tried to compile this using javac -cp Org;Org.ex Org/ex/why/MyClass.java from the current directory where org is present. It does not compile. Please clarify.
Someone please clarify
Just in case there are getters and setters then what will be the answer. I just want to know. Thanks
but area is declared final. That means,
if an object has length = 4 and breadth = 2
then area is calculated as 8.
Later on when this object is changed, lets say, length is changed to 3 , area will still remain 8 because it is final.

That does not mean this object with values (3,2,8) equal to object with values (3,2,6).
Please clarify where i am wrong.
NO it just says that equals method has been implemented correctly but definition is not given.
source: Whizlabs

What will be the most appropriate implementation of hashcode() method assuming equals implemented correctly.

Ans is


I thought that answer would be


Please explain why the given answer is correct. Thanks.