rajakumar babu

Greenhorn
+ Follow
since Nov 12, 2003
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 rajakumar babu

A simple solution would be create a poller servlet, create a
private static int counter; - static variable and increment it in your doGet() / doPost() method. This would be simple solution, but if you really want genuine hits on unique IP addresses, you might look around on the web though.
17 years ago
Find and Replace is pretty simple, all you need to do is, for every line you read from 1st file, you want 'xxx' to be replaced with some text, so call a method by passing line as parameter and in that method, you read second file and return a match string to replace. So, the calling method would have code something like this:

While((line = someReader.readLine()) != null) {
String replaceString = readSecondFileAndReturnString(String line);
...........
...........
}

Hope this helps you
17 years ago
Think this way. Static methods are class methods. When you say 'class' methods, the method is associated with the class(blue print itself) rather than instances(copies). So, irrespective of the no. of objects you create(copies you make from class) on the class, this 'static' method is one and only one, since it is static.
17 years ago
Two ways:

(1) Add it to your system classpath
(2) Drop the jar under $:\jdkx.x\jre\lib\ext folder

Either case,it works fine !
17 years ago
Jar - comprises bundled class files, Enterprise applications etc
WAR - is a Web Archive where you bundle your web application stuff
EAR - is an Enterprise Archive comprising both your WAR and JAR
17 years ago
You could better start off with Servlets, then go for JSPs.
Also, try visiting http://www.javaranch.com/scwcdfaq.jsp link for more info.
Thanks, it helped me a great in understanding the STM Interface,
rajakumar.
You could always add "Tomcat x.x\common\lib\servlet.jar" to your Env. classpath variable or while compiling servlet, just add the above jar to the existing classpath and compile
Hope this helps.
In the below jsp, the page directive attribute isThreadSafe is "false" => implements SingleThreadModel. So, when I opened this page in 2 different browsers, the result should be the same (ie. 0,1,2,3,4,5,6,7,8,9) since container should create 2 instances of the same jsp. But, the output i am getting is (0,1,2,3,4,5,6,7,8,9 - in Browser1) and (10,11,12,13,14,15,16,17,18,19 - in Browser2)
Why is it behaving this way ?
-----------------------------------------------------------
<html><body>
<%@ page isThreadSafe="false" %>
<%! int j=0; %>
<%
for (int i=0; i<10; i++)
{
out.print("The value of j is " + j + "<br>");
j++;
Thread.currentThread().sleep(1000);
}
%>
</body></html>
-----------------------------------------------------------
Regards,
Kumar.