Title: JSP Elements
1JSP Elements
lthtmlgt ltbodygt The value of a mathematical
expression is lt Math.sin(3.14159/2.0)
Math.sqrt(2)gt lt/bodygt lt/htmlgt
Expression
lthtmlgt ltbodygt The value of a mathematical
expression is lt double exp
Math.sin(3.14159/2.0) Math.sqrt(2)
out.println("" exp) gt lt/bodygt lt/htmlgt
Scriptlet
local variable in service method
instance variable in created servlet
lthtmlgtltbodygtlt! int count1 gt This is a test
lt out.println("" count) gt lt/bodygtlt/htmlgt
lthtmlgtltbodygt This is a test lt int count1
out.println("" count) gt lt/bodygtlt/htmlgt
Declaration
vs.
2JSP Elements, continued
lthtmlgtltbodygtlt_at_ page import"java.util." gt
This is a test of the import directive. lt
List mylist() new ArrayList()
mylist.add("foo") mylist.add("bar")
gt lt/bodygtlt/htmlgt
page directives
3Two more for you to learn about
Why?See handouts...