JSP 內建物件
阿新 • • 發佈:2021-11-22
request 物件:HTTP 通訊 協議 是 客戶 與 伺服器 之間 一種 提 交 (請求) 信 息 與 響 應信 息 (request/respone)的通訊協議。
Example3_1.jsp: <%@ page contentType="text/html;charset=GB2312" %> <HTML> <BODY bgcolor=green><FONT size=1> <FORM action="tree.jsp" method=post name=form> <INPUT type="text" name="boy"> <INPUT TYPE="submit" value="Enter" name="submit"> </FORM> </FONT> </BODY> </HTML> --------------------- tree.jsp:<%@ page contentType="text/html;charset=GB2312" %> <HTML> <BODY bgcolor=green><FONT size=1> <P>獲取文字框提交的資訊: 80 <%String textContent=request.getParameter("boy"); %> <BR> <%=textContent%> <P> 獲取按鈕的名字: <%String buttonName=request.getParameter("submit");%> <BR> <%=buttonName%> </FONT> </BODY> </HTML>