Jsp First program


Prev Tutorial Next Tutorial

Jsp First program

Here i will give you a simple jsp example. First you write your first jsp code on any editor and save with .jsp extension like below;

Save and Compile jsp program

JSP program must be save with the .jsp extension. And for compile jsp code simply follow step of compilation servlet code.

Example

<html>  
<body>  
<% out.print("Hello word"); %>  
</body>  
</html>  

Result

Hello word

How to run jsp program

After write your jsp code, deploy jsp program in your root directory and start server. Follow below steps to run jsp code.

  • Deploy jsp code in root directory
  • Start Server
  • Visit on browser or give request with url like below

Syntax

 http://localhost:portnumber/RootDirectory/jspfile
 

Example

http://localhost:2015/jspapplication/index.jsp
 

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements