<div dir="ltr" style="text-align: left;">
<div dir="ltr" style="text-align: left;">
<p>To create the first jsp page, write some html code as given below, and save it by <b>.jsp</b> 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.Lets create <b>index.jsp</b> file to display Hello World!! and also add scriptlet code.</p>
<pre class="highlight"><;html>; 
<;body>;>; 
<;h1>; Hello World!!<;/h1>; 
 <;% out.print(34+23); %>; 
<;/body>; 
<;/html>; 
</pre>
<p>To run this jsp file firstly set up the environment for running this example.<br />
<b>Setting up Java Development Kit</b><br />
This step involves downloading an implementation of the Java Software Development Kit (SDK) and setting up PATH environment variable appropriately.</p>
<p>You can download SDK from Oracle&#8217;s Java site: Java SE Downloads.</p>
<p>Once you download your Java implementation, follow the given instructions to install and configure the setup. Finally set PATH and JAVA_HOME environment variables to refer to the directory that contains java and javac, typically java_install_dir/bin and java_install_dir respectively.</p>
<p><b>Setting up Web Server: Tomcat</b><br />
A number of Web Servers that support JavaServer Pages and Servlets development are available in the market. Some web servers are freely downloadable and Tomcat is one of them.</p>
<p>Apache Tomcat is an open source software implementation of the JavaServer Pages and Servlet technologies and can act as a standalone server for testing JSP and Servlets and can be integrated with the Apache Web Server.<br />
1. Download latest version of Tomcat from http://tomcat.apache.org/.<br />
2. After downloading unzip the file<br />
For example in <i><b>C:Program Files (x86)Apache Software FoundationTomcat 7.0.</b></i> on windows, or <i><b>/usr/local/Tomcat 7.0</b></i>. on Linux/Unix and create <b>CATALINA_HOME</b> environment variable pointing to these locations.</p>
<p>Tomcat can be started by executing the following commands on windows machine:<br />
<b><i>C:Program Files (x86)Apache Software FoundationTomcat 7.0binstartup.bat</i></b></p>
<p>After a successful startup, the default web applications included with Tomcat will be available by visiting <i><b>http://localhost:8080/.</b></i> If everything is fine then it should display following result:</p>
<div class="separator" style="clear: both; text-align: center;"><img src="https://dineshonjava.com/wp-content/uploads/2013/09/121212.png" width="640" height="445" border="0" /></div>
<p>Tomcat can be started by executing the following commands on windows machine:</p>
<p><i><b>C:Program Files (x86)Apache Software FoundationTomcat 7.0binshutdown.bat</b></i></p>
<p><b>Setting up CLASSPATH</b><br />
Since servlets are not part of the Java Platform, Standard Edition, you must identify the servlet classes to the compiler.</p>
<div class="separator" style="clear: both; text-align: center;"><img src="https://dineshonjava.com/wp-content/uploads/2013/09/121111.png" border="0" /></div>
<p>Now copy index.jsp file into <b> </b><br />
<b>C:Program Files (x86)Apache Software FoundationTomcat 7.0webapps</b><br />
And restart the server and hit the following url.<br />
<i><b>http://localhost:8080/index/index.jsp</b></i></p>
<div class="separator" style="clear: both; text-align: center;"><img src="https://dineshonjava.com/wp-content/uploads/2013/09/22222.png" border="0" /></div>
</div>
<div style="background-color: pink; border-width: thin; text-align: center;"><b><;<;<a href="https://dineshonjava.com/life-cycle-of-jsp-page/">Previous</a> <;<; || <a href="https://dineshonjava.com/jsp-tutorial-baby-step-to-server-pages/">Index </a>|| >;>;<a href="https://dineshonjava.com/jsp-scripting-elements/">Next</a> >;>;</b></div>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/life-cycle-of-jsp-page/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/jsp-scripting-elements/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '348'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…