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/

相关文章:

  • 2021-05-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-04-16
相关资源
相似解决方案