hello.jsp和show.jsp在相同的Web服务目录中。用户访问hello.jsp页面后,在页面的<form>表单中的两个文本框中分别输入:12和8,然后单击名字是“送出”的提交键请求访问show.jsp页面,然后用户在show.jsp页面的“JSP实用教程第4版”文字下方看到的信息是( ) 。Hello.jsp
<%@ page contentType="text/html" %>
<%@ page pageEncoding = "utf-8" %>
<HTML><body bgcolor = #ffccff>
<form action="show.jsp" method=post >
<input type="text" name="hello" />
<input type="text" name="good" />
<input type="submit" name="submit" value="送出"/>
</form>
</body></HTML>
show.jsp
<%@ page contentType="text/html" %>
<%@ page pageEncoding = "utf-8" %>
<HTML><body bgcolor = pink>
<%
request.setCharacterEncoding("utf-8");
String strOne=request.getParameter("hello");
String strTwo=request.getParameter("good");
String strResult="";
int m =0,n = 0;
int result = 0;
try{
result = Integer.parseInt(strOne)+Integer.parseInt(strTwo);
strResult=""+result;
}
catch(NumberFormatException exp){
strResult ="不是数字";
}
%>
<h1>JSP实用教程第4版</h1>
<%= strResult %>
</body></HTML>