request对象
客户端的请求信息被封装在request对象中,通过它才能了解客户的需求,然后做出响应,他是HttpServletRequset类的实例request对象具有请求域,即完成客户的请求之前,该对象一直有用
String getparameter(String name)返回那么name指定参数的参数值
string[] getParameterValues(String name)返回包含namede 所有值的数组
void setAttribute(String,Object)储存此请求中的属性
object getAttribute(String name)返回指定属性的属性值
string getContentType()得到请求体的MIME类型
string getprotocol()返回请求用的协议类型及版本号
string getServerName()返回接受请求的服务器主机名
请求客户端的ip地址:<%=request.getRemoteAddr() %><br>
请求的真实路径:<%=request.getRealPath("JSP内置对象(上).jsp") %><br>
请求的上下文路径:<%=request.getContextPath() %><br>
<%--<input type="checkbox">把复选框成为单选--%>
<%--<td colspan="2">行的合并--%>
<%--<td rowspan="2">列的合并--%>
<%--两者的区别是submit按钮能提交表单。而button只是一个纯粹的按钮,在没有加什么js代码的情况下,它只是个装饰。不过,如果加了js代码后,button按钮就可以实现submit按钮的一切效果。--%>
<h1>用户注册</h1>
<form name="loginFrom"action="05.jsp" methed="post">
<table>
<tr>
<td>用户名:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>爱好:</td>
<td>
<input type="checkbox" name="favorite" value="read">阅读
<input type="checkbox" name="favorite" value="music">音乐
<input type="checkbox" name="favorite" value="movie">电影
<input type="checkbox" name="favorite" value="internet">上网
<input type="checkbox" name="favorite" value="play game">打游戏
</td>
</tr>
<td colspan="2"><input type="submit" value="提交"></td>
</table>
</form>
<br>
<br>
<a href="05.jsp?username=李四">url传参数</a>
</body>
</html>