在一个JSP页面转到另一个JSP页面时,对表单中的参数用EL表达式提取为:
 
 
<form action="sampleJsp.jsp" method="post"> 
    <input type="text" name="sampleValue" value="10" /> 
    <input type="text" name="sampleValue" value="11" /> 
    <input type="text" name="sampleValue" value="12" /> 
    <input type="text" name="sampleSingleValue" value="SingleValue"/> 
    <input type="submit" value="提交"/> 
   </form> 

xx.jsp 的 <body>中    有 

    ${paramValues.sampleValue[2]} 
    ${param.sampleSingleValue } 

显示结果为12 SingleValue 

第一个EL表达就相当于在servlet中使用request.getParameterValues("sampleValue"); 

第二个EL表达式就相当于在servlet中使用request.getParameter("sampleSingleValue"); 

 

相关文章:

  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2021-12-26
相关资源
相似解决方案