不通过action,实现页面之间传值

    技术2025-10-07  7

    <s:include value="currentLocation.jsp"> <s:param name="productname" value="nick"></s:param> </s:include>   

    在currentLocation.jsp中,通过el表达式取值:

    ${param.productname}

    但strts2标签不支持el表达式,如:

    <s:property value="getproduct(${param.productname})"> 出错,

    所以先用java代码在本页面先set给request:

    request.setAttrubute("name", request.getParameter("productname")); <s:property value="getproduct(#request.name)">

     

     

    最新回复(0)