In this example we will show you how to create first web page on tomcat server. JSP simply application that work with Java inside HTML pages. Now we can take any existing HTML page and we change its extension to "hello.jsp" instead of "hello.html". This one the simply exercise for your first application JSP. Just modify file extension from ".html" to ".jsp" as you used to do in case of designing html pages. Then the application load the new file, with the "Hello.jsp" extension, in your browser.
Following example will really help you understand a jsp page.
In this example we are going to print the String "HELLO World" on to a web page.
Start the tomcat server, open a browser window and type the URL : Start the tomcat server, open a browser window and type the URL http://localhost:8080/hello.jsp
The code of the hello.jsp is given below:
The output of the program is given below:
Posted on: July 8, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles