Creating a JSP Page
A JSP page looks similar to an HTML page, but a JSP page also has Java code in it. We can put any regular Java Code in a JSP file using a scriplet tag which start with
<% and ends with
%>. JSP pages are used to develop dynamic responses.
To learn HTML, go to HTML Interactive Course and learn HTML while practicing it side by side.
Example of creating a JSP Page in Eclipse
- Open Eclipse, Click on New → Dynamic Web Project
- Give a name to your project and click on OK
- You will see a new project created in Project Explorer
- To create a new JSP file right click on Web Content directory, New → JSP file
- Give a name to your JSP file and click Finish.
- Write something in your JSP file. The complete HTML and the JSP code, goes inside the
<body> tag, just like HTML pages.
- To run your project, right click on Project, select Run As → Run on Server
- To start the server, Choose existing server name and click on finish
- See the Output in your browser.