1203 Jsps
1203 Jsps
(2005.04.20)
http://java.sun.com/products/jsp/ http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
<%= - evaluates expression, converts results to string and outputs it into HTML <%! - Java declaration
<%@ - followed by method, import, implements, extends <jsp: useBean ...\> - specify a Java Bean
JSP File
extension .jsp generally placed in root of Tomcat container in NetBeans converted to servlet by container upon first execution request
Example JSP
<%@page contentType="text/html"%> <html> <head><title>JSP Page</title></head> <body bgcolor="red" text="white"> <%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%> <%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%> <CENTER> <H2> The date and time is: <br> <%= new java.util.Date() %> </H2> </CENTER> </body> </html>
Implicit Objects
object that is exists without declaration for example, the output stream object cout in C++ is declared in the library iostream