3
可能重複:
How to get parameters from the URL with JSP獲取參數從URL中JSP
請幫助! 我想使用JSP從「http://111.0000.0000.0000/2-abc-xyz?sessid=32323232-232322323
」中提取sessid。
可能重複:
How to get parameters from the URL with JSP獲取參數從URL中JSP
請幫助! 我想使用JSP從「http://111.0000.0000.0000/2-abc-xyz?sessid=32323232-232322323
」中提取sessid。
嘗試
EL表達式
${param.sessid}
或Java代碼。
String value=request.getParameter("sessid");
或者
使用java.net.URI中,
URI uri=new URI("http://111.0000.0000.0000/2-abc-xyz?sessid=32323232-232322323");
System.out.println(uri.getQuery());