?? lx10_9.jsp
字號(hào):
<%@ page language="java" %>
<jsp:useBean id="jb1" scope="page" class="jspbean.Bean1" />
<html>
<head> <title>JSP程序</title>
</head>
<body>
<form name="form1" method="post" action="">
<p>求階乘程序</p>
<p>輸入一個(gè)數(shù)
<input type="text" name="textfield" >
</p>
<p>
<%
try {
String xs;
int x;
xs=(String) request.getParameter("textfield");
x=Integer.parseInt(xs);
jb1.setx(x); //向Bean組件添加數(shù)據(jù)
out.println(x);
%>
的階乘值為:
<%
out.println(jb1.jc()); //從Bean組件獲取數(shù)據(jù)
} catch (Exception e)
{
out.println("無(wú)輸入數(shù)據(jù)");
}
%>
</p>
<p>
<input type="submit" name="Submit" value="提交">
</p>
</form>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -