1. 首页
  2. 数据库
  3. 其它
  4. 在jsp页面如何获得url参数

在jsp页面如何获得url参数

上传者: 2021-01-15 17:10:44上传 PDF文件 31.56KB 热度 23次
当一个url过来时,如:http://localhost:8080/pro/demo/hello.jsp?name=john,在hello.jsp页面,我们可以这样得到name的值: 代码如下: <% String path = request.getContextPath(); String basePath = request.getScheme()+”://”+request.getServerName()+”:”+request.getServerPort()+path+”/”; String name = request.getParameter(“name”);//
下载地址
用户评论