Previous | Home | Next |
JSP page is create with write a html code, and save as .jsp extension. We have save this file as index.jsp. Put it in a folder and paste the folder in the web-apps directory in apache tomcat to run the jsp page.
Let's see the simple example of JSP, here we are using the scriptlet tag to put java code in the JSP page. We will learn scriptlet tag later.
<html> <body> <% out.print(2*5); %> </body> </html> <html> <body> <% out.print(2*5); %> </body> </html>
How to run JSP page
These are steps used to run JSP page.
- Start the server
- put the jsp file in a folder and deploy on the server
- visit the browser by the url http://localhost:portno/contextRoot/jspfile e.g. http://localhost:8888/myapplication/index.jsp
Previous | Home | Next |