下面是搜索结果部分的代码
怎么改
才能把删除值得编号选中应该改成什么样的选择。。(项目没在myeclipse情况下。)
<%@ page language="java" contentType="text/html; charset=windows-31j" pageEncoding="windows-31j"%>
<%@ taglib uri="/WEB-INF/lib/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/lib/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/lib/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/lib/struts-tiles.tld" prefix="tiles"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
<title>論文カテゴリの検索</title>
</head>
<BODY>
<h1>
論文カテゴリ一覧
</h1>
<div align="center">
<table border="2"> <FORM action="/TestCategory/JSP/delecategory.do" method="post" name="formc">
<tr>
<th>
操作
</th>
<th>
論文カテゴリ番号
</th>
<th>
論文カテゴリ名
</th>
<th>
入力制限
</th>
<th>
最大共著人数
</th> </tr>
<logic:iterate id="CategoryList" name="list">
<tr>
<td>
<input type="radio" name="radio" value="<bean:write name="CategoryList" property="paper_category"/>"> </td>
<td>
<bean:write name="CategoryList" property="paper_category" />
</td>
<td>
<bean:write name="CategoryList" property="paper_category_name" /> </td>
<td>
<bean:write name="CategoryList" property="rule" />
</td>
<td>
<bean:write name="CategoryList" property="authors_max" />
</td> </tr> </logic:iterate> </table>
<INPUT type="submit" value="削除">
</FORM>
</div> </body>
</html>

解决方案 »

  1.   

    要使上面的问题没法解决
    那谁能告诉我页面上选中一个值(只不是固定值,是搜索出来的值,进行选中就算宣布出来一组值,选出来一个值也行)
    怎么做到呢
    就想把他传到后台action 里面去
    大家帮帮忙谢谢真的是。。想不明白阿
      

  2.   

    1、
    页面单选框改成复选框
    <input type="checkbox" name="deleteall" value='<bean:write name="suggestinfo" property="id" />'/>后台代码
    String id[] = request.getParameterValues("deleteall");
    String sql = "delete from suggestinfo where id='" + id[0] + "'";
    if(id.length > 1)
    {
    for(int i = 1; i < id.length; i ++)
    {
    sql += " or id='" + id[i] + "'";
    }
    }
    SuggestInfoBO.delSuggestInfo(sql);
    2、如果你使用ActionForm的话复选框也可以用Struts标签,Form中有字符串数组对应就可以取值了//以前写过的,希望你用的上^_^
      

  3.   

    从来没用过刚刚查checkbox好像是javascripe的语句能不能具体写一条
    比方说
    我就选中属性为 paper_category这一项
      

  4.   

    不好用
    我之前用的是radio
    raido和checkbox有异曲同工的作用但是都不行。。都试了
    值进不去
      

  5.   

    不会吧,值进不去后台,还是value中没有值?
    能看一下你生成完网页的源码吗?
      

  6.   

    <%@ page language="java" contentType="text/html; charset=windows-31j" pageEncoding="windows-31j"%>
    <%@ taglib uri="/WEB-INF/lib/struts-bean.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/lib/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/lib/struts-logic.tld" prefix="logic"%>
    <%@ taglib uri="/WEB-INF/lib/struts-tiles.tld" prefix="tiles"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
    <title>論文カテゴリの検索</title>
    </head>
    <BODY>
    <h1 align="center">
    論文カテゴリ一覧
    </h1>
    <div align="center">
    <table border="2"> <FORM action="/TestCategory/JSP/delecategory.do" method="post" name="formc">
    <tr>
       <th>
    操作
    </th>
    <th>
    操作
    </th>
    <th>
    論文カテゴリ番号
    </th>
    <th>
    論文カテゴリ名
    </th>
    <th>
    入力制限
    </th>
    <th>
    最大共著人数
    </th> </tr>
    <logic:iterate id="CategoryList" name="list">
    <tr>
        <TD>
        <INPUT type="checkbox" name="id" value=<bean:write name="CategoryList" property="paper_category"/> >
        </TD>
        <TD>
        <INPUT type="submit" value="削除">
         </TD>
    <td>
    <input type="radio" name="radio" value="<bean:write name="CategoryList" property="paper_category"/>">
    </td>
    <td>
    <bean:write name="CategoryList" property="paper_category" />
    </td>
    <td>
    <bean:write name="CategoryList" property="paper_category_name" /> </td>
    <td>
    <bean:write name="CategoryList" property="rule" />
    </td>
    <td>
    <bean:write name="CategoryList" property="authors_max" />
    </td> </tr> </logic:iterate> </table>
    <INPUT type="submit" value="削除">
    </FORM>
    </div> </body>
    </html>
      

  7.   

    进不了action 
    至于value里面有没有值
    我不会看我作了个最简单的测试
    都无法进入action
    后台更加是什么也不报页面报错HTTPステータス 500 - マッピング /JSP/delecategory に対するinput属性が指定されてません--------------------------------------------------------------------------------type ステータスレポートメッセージ マッピング /JSP/delecategory に対するinput属性が指定されてません説明 The server encountered an internal error (マッピング /JSP/delecategory に対するinput属性が指定されてません) that prevented it from fulfilling this request.
    --------------------------------------------------------------------------------Apache Tomcat/5.5.25
      

  8.   

    1、右键-查看网页源代码
    <INPUT type="checkbox" name="id" value=有值吗?> 
    这里要是有值那就是接收时出了问题
    还有可能就是没有直接跳到Action中,request废了2、如果页面有值的话你也可以写一个JavaScript,取到值后拼起来,中间加分割符
    传到后台解析3、如果你的页面中有不止一个form表单,那么后台也可能取不到值,建议用method='post'
      

  9.   

    <FORM action=<%=request.getContextPath()%>/LoginAction.do?action=adduser method=post></form>
    建议这样写
      

  10.   

    这样要是不对那可能是你的struts-config.xml配置错了
      

  11.   

    这样要是不对那可能是你的struts-config.xml配置错了
    不应该对应formbean
    谢谢怎么加分???
      

  12.   

    因为传回去的只是是一个值
    对应不上formbean