|
Explanation
Above page appears to be a simple HTML page except one line of Java code between the <% and %> tags. These work the same way as <% %> tags in ASP. You can add server side Java code between these tags. In this case we simply declared a variable 'name' of type String ( simple text ) and initialized it with a value of "Faisal Khan", you can substitute your own name if you want.
<%
String name = "Faisal Khan";
%>
Next we display the value of 'name' variable to the user.
<p>Hello <%= name %>!</p>
Start Tomcat server and point your browser to http://localhost:8080/star/index.jsp
to see the JSP page running.
Summary
In this article I introduced JSP as a new, efficient, scalable and secure technology to develop web applications. I then walked you through the steps of downloading and installing Tomcat 6.0.14. Tomcat is Java web container ( Servlet Container and
JSP Engine ) available for free from Apache Software Foundation. In the end we built and tested a simple JSP page 'index.jsp'.
|