【正文】
oLocaleString() % An Example of Scripting Elements %@ page import=.* % % Calendar myCalendar = ()。 int currenthour = ()。 % Wele! br % if (currenthour 12 ) {% Good Morning! %} else if ((currenthour 12) amp。amp。 (currenthour 18)) {% Good Afternoon! %} else {% Good Evening! %}% An Example of Actions html headtitleInclude Date JSP at Request Time/title/head body bgcolor=white font color=blue The current date and time are jsp:include page= / /font /body /html : %@ page import=.* % Getting date... %= (new () ).toLocaleString()% Use JavaBeans with JSP JSP Web Container Request Response Browser Server Database JavaBeans JavaBeans JSP JSP handles the face. JavaBean handles the logic and plexity. A Example of Using JavaBean %@ page contentType=text/html。 charset=gb2312 session=true % !DOCTYPE HTML PUBLIC //W3C//DTD HTML Transitional//EN jsp:useBean id=Calculator class= scope=session / jsp:setProperty name=Calculator property=*/ html head titleUse Bean in JSP to Calculate/title /head body pFONT color=39。Red39。 face=39。Arial39。 size=39。339。 你一般每天需要 jsp:getProperty name=Calculator property=result / 卡能量 /FONT/p How to Write the JavaBean public class CalMeasure { // properties defined public CalMeasure() { } public int getProperty() { return 。 } public void setProperty(type value) { =value。 } Other method } Exercises 3 ? Programming: Create a database in pointbase, setup a table with the name, studentid, major, and contact of your group, display these contents with a servlet or jsp. (Extra credit: if user can modify the database information through a browser, . add/update)