1,?dispatch=view是参数
2,你说得很对,ActionForm为 forward中所对应的,为空他会自动初始化的,至于初始化成什么样子,我没见过。

解决方案 »

  1.   

    你在articleForm中定义这个对象的初始值是什么就是什么拉
      

  2.   

    http://www.eaoo.com/design/list.asp?classid=2&Nclassid=14
      

  3.   

    多谢楼上两位,这里的paramProperty代表的是ActionForm中的一个属性吧?这里为"Key",但是paramId代表什麽?文档上说代表的是request中得到的参数,但是这里是在<html:link中指定的,怎麽会是从request中得到的呢?如果是的话,这里的paramId="Key"这个"Key"是怎样得到的呢?请指点
      

  4.   

    html:link中的paramProperty和bean:write中的property也应该是对应的阿,但他们为什麽不一致?我看了Jpetstore的原码:
    <html:link paramId="itemId" paramName="cartItem" paramProperty="item.itemId" page="/shop/viewItem.do">
     <bean:write name="cartItem" property="item.itemId" /></html:link></b></td>
      <td><bean:write name="cartItem" property="item.productId" /></td>
      <td>
         <bean:write name="cartItem" property="item.attribute1" />
         <bean:write name="cartItem" property="item.attribute2" />
         <bean:write name="cartItem" property="item.attribute3" />
         <bean:write name="cartItem" property="item.attribute4" />
         <bean:write name="cartItem" property="item.attribute5" />
         <bean:write name="cartItem" property="item.product.name" />
    它这里的property="item.itemId"是怎麽回事?html:link中的itemId是如何动态获得的?
      

  5.   

    to zhou1977(短笛)
      哈哈,还在郑州么?
      

  6.   

    你应该把html:link放在<html:form>里面吧,这样你的'action="/XXX"'应该放在<html:form>里面,这样对应的就是在Struts_comfigo.xml里面就配置相应的action
    在这个action里面再写forward.当然有可能要在你的Struts_comfigo.xml里写对应的form-bean,看看这样对不对吧!!!
      

  7.   

    <html:link paramId="itemId" paramName="cartItem" paramProperty="item.itemId" page="/shop/viewItem.do">
    paramName="cartItem"他表示的是一个你传递过来的Bean,paramID代表这个bean属性的标识可以让你的JSP文件在SCRIPT中引用,paramProperty代表的是bean的属性
      

  8.   

    多谢,这种写法:<html:link paramId="itemId" paramName="cartItem" paramProperty="item.itemId" page="/shop/viewItem.do">
    和直接在struts-config.xml中的<forward中指定 path="/shop/viewItem.do"有区别吗?祈祷的作用是一样的吧?
      

  9.   

    这种写法:<html:link paramId="itemId" paramName="cartItem" paramProperty="item.itemId" page="/shop/viewItem.do">
    和直接在struts-config.xml中的<forward中指定 path="/shop/viewItem.do"有区别吗?祈祷的作用是一样的吧?
    还有就是我看例子中为什麽有的Form Bean类要继承Serialize类?