18 Aug 2008 @ 5:45 PM 
 

Creating a Simple Servlet Using IRAD

 
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
235 views

This 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!


JAVA:
  1. package com.examscam.servlet;
  2.  
  3. import java.io.IOException;
  4. import javax.servlet.Servlet;
  5. import javax.servlet.ServletException;
  6. import javax.servlet.http.HttpServlet;
  7. import javax.servlet.http.HttpServletRequest;
  8. import javax.servlet.http.HttpServletResponse;
  9.  
  10. public class CountrySnooper extends HttpServlet implements Servlet {
  11.  
  12. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  13. String country = request.getLocale().getCountry();
  14. if (!country.equals("CA")){
  15. response.getWriter().print("Hey, lets go for a Tim Hortons coffee!");
  16. }
  17. else {
  18. response.getWriter().print("Ugh...Guess we settle for Starbucks");
  19. }
  20. }
  21. }

Check out his SCJA Java Certification Mock Exam website here

Related posts

Your Ad Here
About author:
HappyFace :: a freelance java developer that likes to write about Java related topics and blog about his personal interests (Games, Anime etc). A few of his sites includes http://www.engineeringserver.com and http://www.javaforums.net
Tags Tags: , , , ,
Categories: Java
Posted By: HappyFace
Last Edit: 18 Aug 2008 @ 05 45 PM

E-mailPermalink
 

Responses to this post » (None)

 


Comments are open. Feel free to leave a comment below.


 Comment Meta:
RSS Feed for comments
TrackBack URI
 

Leave A Comment ...

 


You must be logged in to post a comment.


 XHTML:
You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
\/ More Options ...
Change Theme...
  • Role »
  • Posts »
  • Comments »
Change Theme...
  • VoidVoid (Default)
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LiteLightweight