Aniruddha Bhattacharya

Greenhorn
+ Follow
since Mar 03, 2006
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 Aniruddha Bhattacharya

Hello All,

I have a few questions to ask regarding the preparations for the exam:

1. There are lot of study notes available on the net for SCJP. Do we need to study the notes along with the book or is it advisable to read the whole book first and then refer to study notes.

2. Do we need to solve SCJP questions during reading the book. There are lot of SCJP papers on thenet. is it advisable to shuffle through papers whilst reading the book or is it required after the book is over.

I think these questions will be informative to a lot of other members who intend to prepare for the exam in a systematic manner.

Thanks and Regards,
Aniruddha.
Hello All,

I am sorry for the previous incomplete message. Please follow this.

This is one problem or you can call it a feature of StringTokenizer class that i would like to discuss with all. If we consider the line of code,

String testString = "test1-test2";
StringTokenizer st = new StringTokenizer(testString, "-");
while(st.hasMoreToken()) {
System.out.println(st.nextToken());
}

This will print test1 and test2.

The problem is that if we give the token as -------- (no of -) the result remains unchanged. Thus if we have the code :

StringTokenizer st = new StringTokenizer(testString, "--------");
the result will still be test1 and test2.

The reason for the same being that the token string is a AND combination rather than being an unique token in itself.

If we give the code as:

StringTokenizer st = new StringTokenizer(testString, "s1");

the result is te, t, -te, t2.

The way out to avoid the problem is using the split() method of String class. Can some one discuss the problem in more details and provide some more alternatives about tokenizing and implementation of split().

Thankz in advance.
Aniruddha.
Hello,
I have written a web server that listens to a particular port e.g. 25000. I want to implement a concept that the request which is coming from the client should be refused in case it contains invalid data. For example, if the web server listens to the port and the client sends a request to the port with some data that is not supposed to be met by the server, a sniffer class should detect the invalidity of the request and refuse connection to the server.
The issues in this case are:
1. The validity of the request could be verified after the server accepts the request but in this case as soon as the server accepts the request, a connection object is returned to the client. The requirement is that if the data is not valid, a connection object should not be returned to the client as it is improper to accept the request and then reject the connection.
2. The validity of the data from the client can be verified at the client itself, but in this case there will be not network communication.

Please suggest me how to write a sniffer that stands in between the client and the server and sniffs the data from the client.
Thanks in advance,
Aniruddha
15 years ago
Hello,
I have written a web server that listens to a particular port e.g. 25000. I want to implement a concept that the request which is coming from the client should be refused in case it contains invalid data. For example, if the web server listens to the port and the client sends a request to the port with some data that is not supposed to be met by the server, a sniffer class should detect the invalidity of the request and refuse connection to the server.
The issues in this case are:
1. The validity of the request could be verified after the server accepts the request but in this case as soon as the server accepts the request, a connection object is returned to the client. The requirement is that if the data is not valid, a connection object should not be returned to the client as it is improper to accept the request and then reject the connection.
2. The validity of the data from the client can be verified at the client itself, but in this case there will be not network communication.

Please suggest me how to write a sniffer that stands in between the client and the server and sniffs the data from the client.
Thanks in advance,
Aniruddha
15 years ago
The compiler will execute the finally block in any case. In this when it goes to initilalise the exception object e2 with ex, it will give error as ex is not initialised.
Correct me if wrong.
Thanks and Regards,
Ani.
Hi all....

I joined the site today...m completely new...workin in a software firm....doin lot of web oriented java app....but intend 2 do SCJP....neone wants 2 gimme expert suggestion plz..

Thanks in Advance
Ani.