CS6320: SW Engineering of Web Based Systems
<%= expression %>
expression is evaluated and inserted into Servlets output.
<% code %>
This code is directly inserted into the produced Servlets _jspService() method.
This method is automatically called by the Servlets service() method.
<%! code %>
The code is inserted into the body of the produced Servlet, outside of any existing method (like _jspService())
<%-- comment --%>
Difference between this an HTML comment is this is inserted into the Servlet being produced by evaluating the .jsp file.
Expressions
The expression is evaluated, and then converted to a string and inserted into the page resulting from output of produced Servlet Unlike scriplets, meant for simple kinds of commands. Often will reference one of a number of predefined variables. <%= your_expression %> <jsp:expression> your_expression </jsp:expression> Example from Book EXERCISE
The expression is evaluated, and then converted to a string and inserted into the page resulting from output of produced Servlet
Unlike scriplets, meant for simple kinds of commands.
Often will reference one of a number of predefined variables.
your_expression
Example from Book
EXERCISE
Scriplets
This code is directly inserted into the produced Servlet's _jspService() method. Used for more complicated pieces of code. Like DB access, File I/O, computations, invokation of other classes, servlets, etc. EXERCISE EXERCISE2 (must turn in)
This code is directly inserted into the produced Servlet's _jspService() method.
Used for more complicated pieces of code. Like DB access, File I/O, computations, invokation of other classes, servlets, etc.
EXERCISE2 (must turn in)
Declarations
EXERCISE (must turn in)