Struts - Html:link

博客展示了HTML链接标签的使用,包含单参数和多参数情况。单参数通过paramId和paramName设置,多参数则使用HashMap存储float、int和string数组类型的值,并通过name属性传递,还给出了对应的URL示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  - <html:link action="/myAction" paramId="id" paramName="reqAttrId">LinkName</html:link>
    <a href="/context/module/editPrivilege.do?id=8">EDIT</a>
    8 is request.getAttribute("attrId")

  - <html:link action="/myAction" paramId="id" paramName="idBean" paramProperty="id">LinkName</html:link>
    <a href="/context/module/editPrivilege.do?id=8">EDIT</a>
    8 is [request|session|application].getAttribute("idBean").getId()

  - Multiple Parameters
   

<%
        java.util.HashMap newValues = new java.util.HashMap();
        newValues.put("floatProperty", new Float(444.0));
        newValues.put("intProperty", new Integer(555));
        newValues.put("stringArray", new String[] { "Value1", "Value2", "Value3" });
        pageContext.setAttribute("newValues", newValues);
    %>

    <html:link action="myAction" name="newValues">Float, int, and stringArray via name (Map)</html:link>

    http://localhost:8081/vic/editPrivilege.do?
    stringArray=Value1&stringArray=Value2&stringArray=Value3&floatProperty=444.0&intProperty=555

<%
        java.util.HashMap newValues = new java.util.HashMap();
        newValues.put("floatProperty", new Float(444.0));
        newValues.put("intProperty", new Integer(555));
        newValues.put("stringArray", new String[] { "Value1", "Value2", "Value3" });
        pageContext.setAttribute("newValues", newValues);
    %>

    <html:link action="myAction" name="newValues">Float, int, and stringArray via name (Map)</html:link>

    http://localhost:8081/vic/editPrivilege.do?
    stringArray=Value1&stringArray=Value2&stringArray=Value3&floatProperty=444.0&intProperty=555

<%
        java.util.HashMap newValues = new java.util.HashMap();
        newValues.put("floatProperty", new Float(444.0));
        newValues.put("intProperty", new Integer(555));
        newValues.put("stringArray", new String[] { "Value1", "Value2", "Value3" });
        pageContext.setAttribute("newValues", newValues);
    %>

    <html:link action="myAction" name="newValues">Float, int, and stringArray via name (Map)</html:link>

    http://localhost:8081/vic/editPrivilege.do?
    stringArray=Value1&stringArray=Value2&stringArray=Value3&floatProperty=444.0&intProperty=555

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值