比如这样一个url
http://localhost:8080/demo/hello.jsp?a=hello&b=ni#hao
这时在jsp页面上
String a = request.getParameter("a");
String b = request.getParameter("b");
a的值没问题,a="hello"
但是b的值为 b="ni", 后面的"#hao"都不见了,为什么呢?
如果我想获得完整的参数"ni#hao"应该怎样做呢?
因为我获得这个参数是要根据"#"为分界符号解析有用的。
谢谢!
String url = "http://localhost:8080/demo/hello.jsp?a=hello&b=ni\#hao ";
加了转义字符\后整个String就错了……
桃花长相依
智慧大石