学无止境

面朝大海,春暖花开

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

1、Servlet页面之间传递参数:

   request.getParameter(“paramname”);

request.getParameterMap();

request.getParameterName();

  获取表单中有重复name的标签值。

Map

Set

Entry   entry.iterator();

          (string)entry.getKey();

         (string[])entry.getValue();

 

2、Servlet请求解决中文乱码问题:

  • Post提交:要写在获取第一参数之前request.setCharacterEncoding(“GBK”);
  • Get提交:配置Server.xml中Connetor URIEncoding="utf-8".
  • 页面本身有中文的:response.setContentType(“text\html;charset=gbk”);要写在printer 之前。

3.”/”的含义.

  from中代表http:127.0.0.1/

  web.xml中代表 http:127.0.0.1/myApp/

posted on 2012-01-10 23:20  学+无止境  阅读(561)  评论(0编辑  收藏  举报