<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>   <head>     <base href="<%=basePath%>">         <title>My JSP 'index.jsp' starting page</title>  <meta http-equiv="pragma" content="no-cache">  <meta http-equiv="cache-control" content="no-cache">  <meta http-equiv="expires" content="0">     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">  <meta http-equiv="description" content="This is my page">  <!--  <link rel="stylesheet" type="text/css" href="styles.css">  -->   </head>     <body>     <form action="show.jsp" method="post">     <ul style="list-style;none;line-height:30px">           <li>输入用户姓名:    <input type="text" name="name3"/><br/></li>             <li>Selet Sex:             <input name="sex" type="radio" value="Male"/>Man             <input name="sex" type="radio" value="Female" />Female        </li>               <li> selet password question:           <select name="question">             <option value="mother birthday:">Mother birthday:</option>             <option value="Pet name">Pet name</option>                    </select>        </li>        <li>请输入问题答案: <input type="text" name="key"/>  </li>         <li>selet your habit:          <div>            <input name="like" type="checkbox" value="Singing and dancing" />Singing and dancing            <input name="like" type="checkbox" value="surf on the Internet" />urf on the Internet            <input name="like" type="checkbox" value="Climb" />Climb            <input name="like" type="checkbox" value="Reading" />Reading           </div>       </li>        <li><input type="submit" value="Submit"/>                          </ul>                 </form>     <ul style="line-height:24px">       <li>客户使用的协议:<%=request.getProtocol() %></li>       <li>客户端发送请求的方法:<%=request.getMethod() %></li>       <li>客户端请求路径:<%=request.getContextPath() %></li>       <li>客户机IP地址:<%=request.getRemoteAddr() %></li>       <li>客客户机名称:<%=request.getRemoteHost() %></li>       <li>客户机请求端口号:<%=request.getRemotePort() %></li>       <li>接受客户信息的页面:<%=request.getServletPath()%></li>       <li>获取报头中User-Aget值:<%=request.getHeader("user-agent") %></li>       <li>获取报头中Uaccept值:<%=request.getHeader("accept") %></li>       <li>获取报头中Host值:<%=request.getHeader("host") %></li>       <li>获取报头中accept-encoding值:<%=request.getHeader("accept-encoding") %></li>       <li>获取URI:<%=request.getRequestURI() %></i>       <li>获取URL:<%=request.getRequestURL()%></li>                       </ul>     </body> </html>

Jsp request的更多相关文章

  1. jsp Request获取url信息的各种方法比较

    从Request对象中可以获取各种路径信息,以下例子: 假设请求的页面是index.jsp,项目是WebDemo,则在index.jsp中获取有关request对象的各种路径信息如下 String p ...

  2. jsp request 获取路径

    这篇教程不错:http://zjutsoft.iteye.com/blog/1084260 自己试验如下: System.out.println("-----------------serv ...

  3. jsp request 对象详解

    转自:http://www.cnblogs.com/qqnnhhbb/archive/2007/10/16/926234.html 1.request对象 客户端的请求信息被封装在request对象中 ...

  4. JSP Request方法大全

    协议:request.getProtocol() 输出:HTTP/1.1 服务器信息 getServletConfig().getServletContext().getServerInfo() 输出 ...

  5. jsp request.getParameterValues获取数组值代码示例

    tt.jsp <form action="tt2.jsp" method="POST"> <select name="two&quo ...

  6. JSP - request - 1

    <%@ page language="java" contentType="text/html;charset=utf8" %> <%@ pa ...

  7. jsp request对象

    getParameter( ) :返回name指定参数的参数值 String[]  getParameterValues(String name)    :返回包含参数name的所有值的数值 getA ...

  8. Jsp重定向(response.sendRedirect())和转发(request.getRequestDispatcher().forward(request,r)的差别

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"% ...

  9. JSP 中的 Request 和 Response 对象

    客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求,然后做出响应.它是HttpServletRequest类的实例:response对象包含了响应客户请求的有关信息,但在JSP中 ...

随机推荐

  1. OC随笔一:类

    总结:        在oc中,我们要整出一个类来,首先需要一个.h头文件和一个.m实现文件.一般我们创建的类都继承了根类,因为根类帮我们实现了很多实用的方法,而类里面会有变量(属性) .函数(方法) ...

  2. cocos2dx 动画 一

    1.精灵的runAction方法 spt = Sprite::create("pean.jpg"); this->addChild(spt); MenuItemFont *i ...

  3. jquery的.detach()方法

    .detach()就是从DOM中删除所有匹配的元素. 与.remove()方法不同的是, 这个方法不会把匹配的元素从jQuery对象中删除,所有绑定的事件.附加的数据等都会保留下来,因而可以在将来再使 ...

  4. 手把手教你js原生瀑布流效果实现

    手把手教你js原生瀑布流效果实现 什么是瀑布流效果 首先,让我们先看一段动画: 在动画中,我们不难发现,这个动画有以下特点: 1.所有的图片的宽度都是一样的 2.所有的图片的高度是不一样的 3.图片一 ...

  5. C++第三课(2013.10.03 )

    函数的默认参数: 1.函数的默认参数必须放在形参的右边而且在默认形参的右边不能出现没有无默认参数的形参 2.如果函数的声明给出了默认的参数,那么函数的实现就不能定义默认参 3.声明成员函数时没有给出默 ...

  6. tomcat 显示目录文件列表

    conf/web.xml中,listings改为true,重启 http://liusu.iteye.com/blog/794613 <servlet> <servlet-name& ...

  7. Servlet 中的out.print()与out.writer()的区别

    PrintWriter out = response.getWriter(); out.print(obj)其源码如下: public void print(Object obj) { write(S ...

  8. 调用Android系统设置中的Intent

    开发Android软件时,常常需要打开系统设置或信息界面,来设置相关系统项或查看系统的相关信息,这时我们就可以使用以下语句来实现:(如打开“无线和网络设置”界面) Intent intent = ne ...

  9. SMTP协议--在cmd下利用命令行发送邮件

    先简单介绍下smtp smtp使用命令和应答在客户与服务器之间传输报文.即客户发出一个命令,服务器返回一个应答.发送方与接收方进行一问一答的交互,由发送方控制这个对话. 在XP系统下点‘开始’-‘运行 ...

  10. LeetCode_Text Justification

    Given an array of words and a length L, format the text such that each line has exactly L characters ...