Java Codes »

[10 Feb 2009 | No Comment | 45 views]

No. Java applets may be served by any HTTP server. On the server side they are handled the same as any other file, such as a text, image, or sound file. All the special action happens when the applet class files are interpreted on the client side by a Java technology enabled browser, such as HotJava browser or 1.x or Netscape 3.x/4.x.

Java Codes »

[10 Feb 2009 | No Comment | 48 views]

You can determine the host from where an Applet is loaded using getCodeBase() method.
An example usage is implementing a simple copy protection scheme. If the retrieved codebase does not equal to your predefined host then you can quit.

import java.applet.*;
public class MyApplet extends Applet {
public void init() {
System.out.println(getCodeBase());
//
// you can check the value of getCodeBase()
// to implements a simple copy protection
// scheme. If it’s not equals to your
// URL then quit.
//
}
}

Java Codes »

[10 Feb 2009 | No Comment | 46 views]

Applets can read quite many of system properties by using:

String ss = System.getProperty(String key):

java.version
java.vendor
java.vendor.url
java.class.version
os.name
os.arch
os.version
file.separator
path.separator
line.separator

Java Codes »

[10 Feb 2009 | No Comment | 134 views]

This tip shows how to decode the parameters passed in the URL.

import java.applet.*;
import java.util.*;
public class SimpleApplet extends Applet {
Hashtable searchparms;
public void init() {

Java Tutorials »

[10 Feb 2009 | No Comment | 506 views]
Introduction to Java Servlets with Eclipse (Part4)

(Part1) – (Part2) -  (Part3) – Part4
Implementation of Java Servlet
Back to our Eclipse and modify your index.jsp to something like below.

<form action=”GreetingServlet” method=”POST”>
First Name: <input type=”text” name=”firstName” size=”20″><br>
Surname: <input type=”text” name=”surname” size=”20″>
<br><br>
<input type=”submit” value=”Submit”>
</form>

It means that every time we execute the Submit button in our JSP, it will call GreetingServlet that we created earlier. However, now, our Java Servlet actually do nothing. We need to modify our GreetingServlet.java as well.
This GreetingServlet.java contains our implementation of the Java Servlet. If you carefully pay attention to this file, you …

Java Tutorials »

[10 Feb 2009 | No Comment | 817 views]
Introduction to Java Servlets with Eclipse (Part3)

(Part1) – (Part2) – Part3 – (Part4)
How to Start Tomcat Manually
If you have successfully configured Tomcat, you should have a bin folder of Tomcat. Remember that you need to download the Tomcat from Apache website in the form of zip file. Do not download the .exe file as it would be good if you have a manual hands-on experience on this. It should help you to understand how Tomcat works.

I have extracted my Tomcat into C:\tomcat-5.5.16. Thus, I should have a bin folder that …