Hi Subramainian,
I don't understand why your are not able to run your servlet program in "JRun3.0". You have not mentioned what is the problem you have faced, instead you are trying to down load Jsdk2.X?? What you will do if you face the same problem in Jsdk also.
The procedure for running Servlets (as per JRun documents)
How do I Get Started with Servlets?
Many developers find it helpful to code and run a simple example before reading the documentation. The following procedure tells you how to create a simple servlet:
1. Ensure that JDK 1.1.8 (or higher) has been installed.
2. Ensure that the system path includes the JDK's bin directory.
3. Enter the following code and save it as MyFirstServlet.java in <jruninstalldirectory>/servers/default/default-app/WEB-INF/classes (replace <jruninstalldirectory> with the path to the directory in which you installed JRun for e.g c:\JRun\):
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class MyFirstServlet extends HttpServlet {
public void doGet(HttpServletRequest req,
HttpServletResponse res) throws IOException, ServletException {
// Specify content type.
res.setContentType("text/html");
// Access the output stream.
PrintWriter out = res.getWriter();
// Return HTML.
out.println("<html><head><title>My First Servlet");
out.println("</title></head><body>");
out.println("<h1>My First Servlet</h1>");
out.println("<p>This text came from a servlet.</p>");
out.println("</body></html>");
}
}
Compile your code by entering the following commands:
cd <jruninstalldirectory>\servers\default\default-app\WEB-INF\classes
javac -classpath ".;<jruninstalldirectory>\lib\ext\servlet.jar" MyFirstServlet.java
Ensure that the JRun default server is running.
Open a browser and specify the following URL:
http://<server>:8100/servlet/MyFirstServlet The previous URL assumes that the JRun default server is running on port 8100. If you have run the Connector Wizard successfully, you can also use
http://<server>/servlet/MyFirstServlet Note: The default server will listen at port ":8100" you can change it in DefaultServer set up.
Try the above example.
solaiappan