Posted by: Chyne on: March 7, 2009
• Some common pre-defined variables
- request
- response
- out (the writer object to send output)
- session (session are automatically created, use a directive to disable)
- application (allows storing of data that is shared by other servlets /or JSP)
• JSP page directives
- Affects the overall structure of the servlet that is generated from the JSP
- Format :
(i) <%@ directive attribute = “value”>
(ii) <%@ page import=”java.util.*”%>
(iii) <%@ page session=”false” autoflush=”false”%>
(iv) <%@ [...]
Posted by: Chyne on: March 7, 2009
• What is a JSP?
- HTML web page mixed with Java code to generate dynamically contents.
- Java code is enclosed in <%….%> tags
- Full access to Java programming language (but only Java code used for writing servlet is applicable)
- Automatically translated to Java servlet.
• Why JSP?
- More convenient to write than ‘println’
- No ‘web.xml’ config
- Promote separation between presentation and application logic
Note: Browser only [...]
Posted by: Chyne on: March 25, 2008
When compiling a .jsp file, Tomcat will create a .java file before creating a class. If you want to check the java file, you can find the java file in this location:
Tomcat5.0workCatalinalocalhost\orgapachejsp