priya thomas

Greenhorn
+ Follow
since Mar 17, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by priya thomas

thanks its working now..
16 years ago
Hi Sumit,

thanks for responding.

I don't have a first - just a date.jsp in my c:\tomcat\webapps folder.
(sorry for the confusion i shudve probably started a new thread, but i was trying to find out from the original poster if he got a solution to this same problem i have)

http://localhost:8080/date.jsp is giving me resource not available error.

I have updated my path folder to include c:\tomcat\bin. is there some other configuration i am missing?

i am starting and stopping tomcat (version 6.0.20) through eclipse 3.5.0






16 years ago
Hi Dan,

Did you get a solution to this problem. I have the same problem. I see the welcome page after starting tomcat, and i can also see the examples apache provides. but if i create my own jsp and put it in webapps folder and go to http://localhost:8080/date.jsp it gives me:

requested resource is not available error.
my web.xml looks the same as yours.

Please help,

thanks

Priya
16 years ago
Thanks Rob,

Unfortunately as I mentioned earlier, the LogonPanel class is not mine. From my login class I only have access to an interface:



Implementing the functions onOk and onCancel will allow me to achieve functionality for the Submit and Cancel buttons of my login frame.

The buttons are using an action listener and a key listener (for users who prefer using the keyboard to the mouse)



Ideally I would like to remove KeyListeners on the JOptionPane , since it is the enter key pressed on the YES_OPTION that is causing the problem, but that isnt possible.

I can understand it is difficult to understand the scenario without the SSCCE. Let me rather ask a general button question:
If you don't have access to the button event handlers for a generic class, and you know one of the button event handlers is a keylistener which checks for 'enter' key triggers, is it possible from your class to remove the 'enter' key keyEvent? (I read up a little about inputMaps and removeKeyListener() function, but I'm not sure if that is the way to go)
Also i see that we can just put e.consume() in the keyPressedEvent where KeyEvent e is the enter keyEvent, but that's no use in my case since I'm using pre-written eventHandlers.

Any advice will do thanks

Priya



16 years ago
Hi Michael,

I thought I gave a pretty comprehensive explanation. Do you want me to explain a bit more?

priya thomas wrote:
The problem is that the Enter key event triggers down to the underlying frame and onOk gets triggered again and the JOptionPane pops up again (since the username and password havent been changed yet) and this vicious cycle continues as long as i hit 'enter' or until I use my mouse to click the 'YES_OPTION'
Priya



Thanks,

Priya
16 years ago
Hi Arpit,

Sorry i was away from this for a while. Devaka's post must've answered your question.
I did the SCJP5.0 so I'm not sure about the 6.0 exam, but I think working through lots of thread problems/questions should be the way to go.

Good luck!
Priya
16 years ago
Hi,

I am trying to disable/remove the enter key keyEvent. I'm adding a logonPanel (not created by me) to a loginFrame which I created.
In the logonPanel class, the submit button has a KeyListener which checks for enter key and eventually triggers an Actions interface method which I have overriden.

For incorrect logins a JOptionPane window pops up and asks to retry login and then hitting enter triggers the 'YES_OPTION'. The problem is that the Enter key event triggers down to the underlying frame and onOk gets triggered again and the JOptionPane pops up again (since the username and password havent been changed yet) and this vicious cycle continues as long as i hit 'enter' or until I use my mouse to click the 'YES_OPTION'

Im pasting the getLogonPanel method from my login class:




How can I solve this problem?

Thanks

Priya
16 years ago
Thanks to all for the comments I forgot to mention JavaBeat along with the other simulators/mock exams that helped me.
17 years ago
I did the exam yesterday and passed..thanks to Devaka's simulator, Whizlab and K&B mock exam.

Priya
17 years ago
Thanks for responding. The thing i missed is the additional pkg/Kit.class in the com directory. i only knew about the one in KitJar.jar... I didn't look at the diagram carefully enough. But if pkg was not a subdirectory of com it wouldn't have worked right?

Thanks
Priya
Hi,

Below is a question from LearnKey mock exam (very similiar to K&B chap. 10 ques 12)



As shown there are 2 correct answers. I understand the second answer because I know that we have to include the the jar file name (KitJar.jar) explicitly in the classpath during execution of UseKit.java.

What I don't understand is the first correct answer. It goes against my understanding of jar file names and classpaths as per K&B chapter 10. The answer is explained as: it "finds the unJARed Kit.class file" in the com directory. Where did that file come from? I tried doing it on my own and I found that if the jar file doesnt have a Kit.class file, then an unJARed class file is created in the same directory as KitJar.jar. So it would have worked if KitJar.jar did NOT contain the Kit.class, but it does! So how is the first answer correct for this question?

Please explain.

Thanks
Priya
I have a question from a mock exam:

Can a private method be overridden by a protected method:

Options1: True, Option 2: False

The correct answer as per the exam is Option1.

I am assuming the reason is: private methods CAN be overridden by protected methods, given that both methods are in the same class. Is that correct?

If it is a case of super class and sub class and the super class has the private method and the subclass has the same method with protected (or any) modifier, then the code will compile but we cannot say the method is overridden. Am i right?

Thanks
Priya
I have a question from a mock exam:

Can a private method be overridden by a protected method:

Options1: True, Option 2: False

The correct answer as per the exam is Option1.

I am assuming the reason is: private methods CAN be overridden by protected methods, given that both methods are in the same class. Is that correct?

If it is a case of super class and sub class and the super class has the private method and the subclass has the same method with protected (or any) modifier, then the code will compile but we cannot say the method is overridden. Am i right?

Thanks
Priya
Ps: I read the previous posts, but didnt get a clear answer, so im posting this
Thanks I recompiled after changing the line to:

if(a instanceof java.lang.Number)

and it works

You are right my package name is javaworld and there is already another class named Number in it

Hi,
I'm getting an inconvertible types compiler error when I check whether an Integer type is instanceof Number class.
Is there something illegal with that check?

Code:

import java.lang.*;
class ComparingTypes
{
public static void main(String args[])
{

Integer a = 1;

if(a instanceof Number)
System.out.println("true");
else
System.out.println("false");

}
}

After compiling:
Error: inconvertible types
found : java.lang.Integer
required: javaworld.Number
if(a instanceof Number)
^
1 error

Thanks
Priya