Creating a Simple Servlet Using IRAD
316 viewsThis free, multimedia tutorial shows you how to use IBM's Rational Application Developer (IRAD) to create a J2EE project, a Servlet, and a WebSphere Test Server on which you can proudly run your newly birthed Servlet.
If you found something helpful here, please do your part and help support the site. Link to us, buy some books, support our sponsors, tell your developer friends about us, and remember: Happy Java!
-
package com.examscam.servlet;
-
-
import java.io.IOException;
-
import javax.servlet.Servlet;
-
import javax.servlet.ServletException;
-
import javax.servlet.http.HttpServlet;
-
import javax.servlet.http.HttpServletRequest;
-
import javax.servlet.http.HttpServletResponse;
-
-
public class CountrySnooper extends HttpServlet implements Servlet {
-
-
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
if (!country.equals("CA")){
-
response.getWriter().print("Hey, lets go for a Tim Hortons coffee!");
-
}
-
else {
-
response.getWriter().print("Ugh...Guess we settle for Starbucks");
-
}
-
}
-
}
Check out his SCJA Java Certification Mock Exam website here












