Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!

vijaya saradhi

Ranch Hand
+ Follow
since Dec 31, 2007
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 vijaya saradhi


Hi ,

can any one please clear my doubt about session timeout.In HFSJ it was mentioned like this, if we give -1 as session timeout value the session will never expire.Is it true.
I am doubtful about it.If any one knows please share your knowledge.


adv thanks, vijayasaradhi duggirala
hi all,

in Head First servlets and jsp book it was given like this .A seperate thread is created on every request, and before service() method called a seperate thread is created and control is transferred to service() method().

Does this mean remaining parts of servlet are shared by multiple threads
simultaniously ?

If I declare a HashMap in a servlet class as an instance variable then will it be shared by multiple threads .

I refer this HashMap in doPost()


eg





please tell in the above example if the HashMap h is shared by multiple threads .Is this the proper place to declare a HashMap in a servlet.



my application requirement after upload keep track of all uploaded file in a HashMap .So that when a user tries to delete using a link in the html page servlet shud delete that file only in the file system.
[ December 16, 2008: Message edited by: vijaya saradhi ]
hi ranchers.

I was trying to create a dynamic web project in elipse.For this I need to create a server project .The problem is even though I was able to launch apache tomcat from outside eclipse tool, like startup and shutdown etc.

I followed these steps for creating the project
1.control panel ->admin tools-> services stopped tomcat.
2.opened eclipse -->selected workspace->gave project name -->selcted tomcat base dir -->added the server .


but when I clicked on the Run As -->Run On Server it shows ports 8005 8080 8009 are aleady in use.


I am using windows vista home edition on sony vaio machine.

please help me to run the tomcat project

adv thanks , saradhi
even I too got that kind of error.

I was trying to use tomcat in elipse but was n't successful.
seems the problem lies in elipse tool itself.since I was able to start and shutdown the server from command prompt
thanks a lot Christophe.
I ll check
Hi is there any way to achieve this, i.e file uploading using ajax with following features

1.display the upload stats
2.a progress bar showing upload status

I must use jsp servlets at server side for this.As I found some php solutions difficult to convert in to jsp.

please direct me.
thanks in advance.
hi ranchers, please help me regarding servlet compilation.I am using ubantu 8 linux.The problem is when I create servlets java file and try to compile using javac -classpath [path to servlet-api.jar] -d classes [path to java file]

It gives out errors like http not found .javax.servlet not found etc.
how to set classpath in ubantu linux.

finally I gave up doing it in ubantu and started learning using eclipse in windowns xp platform.
But I want to know is it better to use eclipse to manage all these things like creating a servlet class file and project files creation.

But I want to practice each and every step in HFSJ book .Please clear my doubt.
hi ranchers , I passed scjp 1.4 exam with 83% .Thanks for all your support.

I am planning to take web component developer exam soon. please suggest the right book for me.K& B is a great book for java.But I dont know much about web component exam.

Thanks & regards, saradhi
[ April 14, 2008: Message edited by: vijaya saradhi ]
13 years ago
Consider the following line of code:
byte x=64;
byte y=5;
byte z= (byte)(x*y);
After execution what is value of z?

1. 320
2. 0
3. 645
4. 64

The answer is 64.Well but how can one calculate it.I have copy pasted from one of javabeat mock tests
by default all arithmetic operations involving all numeric types less than int (byte, short, char )will be promoted to int value by the compiler.


so if the destination type is not an int we need to type cast it.
hope I have cleared your doubt
have small doubt in the String manipulation,
String s="test",s1="test",s2="test",s3="test";


I think this is the explanation.

you can rearrange above code like this also.

String s= "test";
String s1= "test";
String s2= "test";
String s3= "test";


if its like this

String s= "test";
String s1= new String("test");
String s2= new String("test");
String s3= new String("test");

each time a new String object will be created and assigned to the reference
variables s, s1, s2, s3 respectively.
so there are totally 4 String objects created in heap.


but since you declare it with string literals, the first time a string literal is found its added to string constant pool memory.

Next time onwards if you declare another String literal with same String content value its not created afresh and previously created string literal will be reused and its address will be assigned to second reference and so on..


i.e,

[1]String s= "test"; //"test" is placed in String constant pool


[2]String s1= "test";// here no String object is created instead s1 contains the address of above String object created at line [1]

//likewise all s2 and s3 will contain address of Object created at [1]
String s2= "test";
String s3= "test";

so ultimately only 1 object is created.

I hope I answered correctly.
[ April 08, 2008: Message edited by: vijaya saradhi ]
thanks a lot Dan.I will practice more mock tests.
Also I will try the mock exam suggested by you to test myself
Hi

I have completed reading K&B book.I have taken the master exam provided K & B.I scored 82 % in that.

But I am doubtful of scoring good marks in real exam.please suggest shall I go ahead and take exam right now.Or do I need to study hard


how much can I score. I mean range
I am using jdk1.4 anyone please tell me if this getId() method is added in 1.5 version.

since my program does not compile if I use the above code as it is.