<div><!-- InstanceBeginEditable name="EditRegion3" -->
     <table width="1024" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="23">&nbsp;</td>
        </tr>
  </table>
      <table width="1024" height="191" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="191" align="center" valign="middle"><span class="STYLE11 STYLE14">
          </span><img src="images/help.png" width="1004" height="197"></td>
        </tr>
      </table>
      <table width="1024" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
      <table width="1024" height="555" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="757" height="555" align="center" valign="top"><table width="749" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><img src="images/caozuo.gif" width="747" height="28"></td>
            </tr>
          </table>

            <table width="760" height="785" border="0" cellpadding="0" cellspacing="0" bordercolor="#66DCF9">
        <TBODY>
           <c:forEach var="pic" items="${requestScope.list}" varStatus="status">
          <c:if test="${status.index%2==0}">
        <tr>
            </c:if>
                <td width="807" height="343" valign="top">
                <form  name="frm" method="post" action="#">
<table width="354" height="343" border="0" align="left" cellpadding="0" cellspacing="0">
                        <tr> <td height="2" colspan="3" align="center" valign="bottom"><hr width="350"></td>
                          <td width="4" rowspan="9" align="left" valign="top"> </td>
                        </tr>
                        <tr>
                          <td width="145" rowspan="7" align="center" valign="middle"><img src="picture/<bean:write name="pic" property="pname"/>" alt="您截取的图片" width="145" height="167"></td>
                          <td height="47"><span class="STYLE18">图片名称:</span></td>
                          <td>
                          <input id="pname" name="pname" type="text" onblur="checkForm()" value="<bean:write name='pic' property='pname'/>" size="18">
                        </td>
                        </tr>
                        <tr>
                          <td width="78" height="39"><span class="STYLE18">图片类型:</span></td>
                          <td width="131"><input name="pformat" disabled="disabled" value="<bean:write name="pic" property="pformat"/>"type="text" size="18"></td>
                        </tr>
                        <tr>
                          <td height="46"><span class="STYLE18">图片宽度:</span></td>
                          <td><input name="pwidth" type="text" value="<bean:write name="pic" property="pwidth"/>" disabled="disabled"size="18"></td>
                        </tr>
                        <tr>
                          <td height="48"><span class="STYLE18">图片高度:</span></td>
                          <td><input name="pheight"type="text" value="<bean:write name="pic" property="pheight"/>" disabled="disabled"size="18" ></td>
                        </tr>
                        <tr>
                          <td height="38"><span class="STYLE18">截图时间:</span></td>
                          <td><input name="pdata" value="<bean:write name="pic" property="pdata"/>" type="text" disabled="disabled"size="18"></td>
                        </tr>
                        <tr>
                          <td height="41"><span class="STYLE18"><a href="javaScript:submits()">删除/批量</a></span></td>
                          <td><input name="deletem" type="checkbox" id="deletem"  value="<bean:write name="pic" property="pictureid"/>"></td>
                        </tr>
                        <tr>
                          <td height="38" valign="middle">
                          <span class="STYLE18">
                          <a href="picture.do?method=updatepictureByName&id=<bean:write name="pic" property="pictureid"/>">修改</a></span></td>
                          <td valign="middle"><span class="STYLE18"><a href="picture.do?method=deletePictureInfo&id=<bean:write name="pic" property="pictureid"/>">删除</a></span></td>
                        </tr>
                        <tr>
                          <td height="1" colspan="3" align="center" valign="middle"><hr width="350"></td>
                        </tr>
                  </table>
                     </form>
    </td>
              <c:if test="${status.index%2==1}">
                    </tr>
                    </c:if>
  </c:forEach>
  </TBODY>
          </table>   </td>
          <td width="267" align="left" valign="top">
  <table width="213" height="188" border="0" cellpadding="0" cellspacing="0" style="background-image:url(images/zhuatu_19.jpg); background-position:center; background-repeat:no-repeat">
            <tr>
              <td height="112">&nbsp;</td>
            </tr>
          </table><br>
          <table width="213" height="188" border="0" cellpadding="0" cellspacing="0" style="background-image:url(images/bbs.jpg); background-position:center; background-repeat:no-repeat">
            <tr>
              <td height="119">&nbsp;</td>
            </tr>
          </table><br>          <table width="213" height="188" border="0" cellpadding="0" cellspacing="0" style="background-image:url(images/question.jpg); background-position:center; background-repeat:no-repeat">
            <tr>
              <td>&nbsp;</td>
            </tr>
          </table><br>
          <br></td>
        </tr>
      </table>这是页面,查询所有出来了,点击修改拿到了ID,但是form里面全是nullpackage com.wantong.org.filecapturescreen.web.actionform;import org.apache.struts.action.ActionForm;public class PictureactionForm  extends ActionForm{ /**
 * 
 */
private static final long serialVersionUID = 1L;
private int pictureid;
private String pname;
private String pdata;
private String psize;
private String pformat;
private String ppath;
private String pimages;
private String pwidth;
private String pheight;
private String classificationType;
private String pstatus;

public PictureactionForm() {
super();
}
public PictureactionForm(int pictureid, String pname, String pdata,
String psize, String pformat, String ppath, String pimages,
String pwidth, String pheight, String classificationType,
String pstatus) {
super();
this.pictureid = pictureid;
this.pname = pname;
this.pdata = pdata;
this.psize = psize;
this.pformat = pformat;
this.ppath = ppath;
this.pimages = pimages;
this.pwidth = pwidth;
this.pheight = pheight;
this.classificationType = classificationType;
this.pstatus = pstatus;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public int getPictureid() {
return pictureid;
}
public void setPictureid(int pictureid) {
this.pictureid = pictureid;
}
public String getPname() {
return pname;
}
public void setPname(String pname) {
this.pname = pname;
}
public String getPdata() {
return pdata;
}
public void setPdata(String pdata) {
this.pdata = pdata;
}
public String getPsize() {
return psize;
}
public void setPsize(String psize) {
this.psize = psize;
}
public String getPformat() {
return pformat;
}
public void setPformat(String pformat) {
this.pformat = pformat;
}
public String getPpath() {
return ppath;
}
public void setPpath(String ppath) {
this.ppath = ppath;
}
public String getPimages() {
return pimages;
}
public void setPimages(String pimages) {
this.pimages = pimages;
}
public String getPwidth() {
return pwidth;
}
public void setPwidth(String pwidth) {
this.pwidth = pwidth;
}
public String getPheight() {
return pheight;
}
public void setPheight(String pheight) {
this.pheight = pheight;
}
public String getClassificationType() {
return classificationType;
}
public void setClassificationType(String classificationType) {
this.classificationType = classificationType;
}
public String getPstatus() {
return pstatus;
}
public void setPstatus(String pstatus) {
this.pstatus = pstatus;
}
}
-----------------这是actionfrom
public ActionForward updatepictureByName(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
int id=Integer.parseInt(request.getParameter("id"));
PictureactionForm pm=(PictureactionForm)form;
Picture picture=new Picture();
picture.setPictureid(id);
picture.setPname(pm.getPname());
int rseult=PictureFactoryService.getinstrance().updatepictureByName(picture);
if(rseult>0){
return mapping.findForward("deletepic");
}else{
return mapping.findForward("fail");
} }
----------------------这是ation

解决方案 »

  1.   


    你用的是鏈接,不是action,沒有提交過去表單,你要修改,要传过去对应的修改数据,不单单是一个ID,要获取form 就要提交表單!
      

  2.   

    建議: 修改跳到action,有ID,在action里面查处对象的数据,转跳另一個頁面赋值(发到文本框里)再提交表单修改
      

  3.   

    那我可不可是调用一个方法:
    function show()

    document.form.action="";
    document.form.submit();