April 12, 2011

Java Server Pages (JSP) - Hello World Example

Create a new file - HelloWorld.jsp - in the WebContent folder of the web application and add the following code in it,

<html> 
<body> 
<%  int i = 3;  %> 
Writing the value of i = <%= i %>
</body> 
</html> 


Test the JSP by typing the following URL in the browser

http://localhost:8080/WebAppName/HelloWorld.jsp 

No comments:

Post a Comment