java - 将标签列显示为单选按钮

标签 java jsp struts2 radio-button displaytag

我在获取与单选按钮(表中的一列)关联的值时遇到问题。它没有返回实际的 conferenceid,而是将 ${conf.conferenceid} 文本返回到对象 selectedConference。有人可以帮助我我在这里做错了什么吗?顺便说一下,这段代码在 Glassfish 上运行,最近迁移到 JBoss,但没有在它上运行。下面是html代码:

<display:table id="conf" name="conferences" requestURI="perConfSearchAction.action" pagesize="10">
    <display:column>
        <input type="radio" name="selectedConference" value="${conf.conferenceId}" onclick="getValue()"/>
    </display:column>
    <display:column property="userName" title="Moderator" sortable="true" />
    <display:column property="passcode" title="Public Pin" sortable="true" />
    <display:column property="moderatorPin" title="Moderator Pin" sortable="true" />                                
    <display:column property="confStartDate" title="Start Date" sortable="true" />                                                                
    <display:column property="confStartTime" title="Start Time" sortable="true" />                                
    <display:column property="confEndDate" title="End Date" sortable="true" />                                
    <display:column property="confEndTime" title="End Time" sortable="true" />                                
    <display:column property="confName" title="Subscription" sortable="true" />
</display:table>

最佳答案

尝试下面的代码

<display:table id="conf" name="conferences" requestURI="perConfSearchAction.action" pagesize="10" uid="row">
  <display:column>
     <input type="radio" name="selectedConference" value="<s:property value='%{#attr.row.id}'/>"/>
  </display:column>
</display:table>

关于java - 将标签列显示为单选按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17516741/

相关文章:

java - tomcat漏洞讨论

java - Struts2 INPUT 结果 : how does it work? 如何处理转换/验证错误?

javascript - 如何设置只读 <s :textarea/> fit to its content

java - 操作无法完成。找不到 Java 运行时。有关安装 Java 的信息,请访问 http ://www. java.com

java - maven 和 spring 应用程序部署错误 : Unable to locate NamespaceHandler for namespace [http://www. springframework.org/schema/context]

java:求和LocalTimes差异

java - 从 Struts2 中的 URL 填充 Action 类实例变量

java - 错误: local class incompatible: stream classdec serialversionUID= . ...,本地类serialversionUID =

java - 带有 Tomcat 8 的 JSP 2.3

java - Struts 2 - 获取应用程序的完整 URL