Artikel Terbaru

Saturday, 3 December 2011

Hellow World Jsp Example

Before setting up deploying JSP on your environment, make sure that JAVA_HOME environment is set. and also download tomcat from the apache site annd should set TOMCAT_HOME environment is set.

Please make sure that PATH and CLASSPATH environment variables are set

Steps to create a first webapplication.
  • Create a HelloWorld folder and the folder structure looks like as followng structure
  • HelloWorld root folder containts following structure
  • Create a first.jsp which prints the hello world code to the console
    Hello World JSP page
    <%@ page language=”java” %>
    <% System.out.println(“Hello World ”); %>
    type the above code in the notepad and name it as 'first.jsp'. please this file into your HelloWorld root folder of your webapplication.
  • deploying HelloWorld webapp to tomcat application. to deploy first webapp to tomcat, simply copy HelloWorld app to tomcat installed directory i.e webapps and start the tomcat server. The start script is located under TOMCAT_HOME\bin\startTomcat.bat for windows.
  • Accessing jsp file. For example, to run first.jsp” file, open a browser to the address: http://localhost:8080/first.jsp This will show you the executed JSP file.
so you are ready with learning with your first jsp page creation.