Saturday, December 3, 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 and should set TOMCAT_HOME environment is set.
Please make sure that PATH and CLASSPATH environment variables are set

Steps to create a first web application.

  • Create a HelloWorld folder and the folder structure looks like as following structure
  • HelloWorld root folder contains the following structure
    java web Application folder structure
    Create a first.jsp which prints the hello world code to the console type the above
    
    code in the notepad and name it as 'first.jsp'. please this file into the HelloWorld root folder of your web application.




Deploying HelloWorld web app to Tomcat application.



  •  to deploy the first web app to tomcat, simply copy HelloWorld app to tomcat installed directory i.e web apps 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.