Struts2 Struts 2使用s:iterator在JSP上仅显示mysql表中的一行

Struts2 Struts 2使用s:iterator在JSP上仅显示mysql表中的一行,struts2,Struts2,struts 2出现了一个非常奇怪的问题,我使用s:iterator拉入一个问题列表,但是当我使用s:property标记时,只会显示ID,而不会显示其他内容。共有4列,id、groupid、subgroup id和questiontxt,但我似乎只能显示id。我测试了列表,它包含了所有列,它已从数据库中正确保存了它们,但我能在屏幕上显示的唯一内容是id <%@ page language="java" contentType="text/html; charset=ISO-8859-1"

struts 2出现了一个非常奇怪的问题,我使用s:iterator拉入一个问题列表,但是当我使用s:property标记时,只会显示ID,而不会显示其他内容。共有4列,id、groupid、subgroup id和questiontxt,但我似乎只能显示id。我测试了列表,它包含了所有列,它已从数据库中正确保存了它们,但我能在屏幕上显示的唯一内容是id

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<link href=<s:url value="resources/welcome.css" /> rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome</title>
</head>

    enter code here

<body>
    <table>
        <s:iterator value="listQuestionsBasic" var="question">
        <tr>        
        <td>
        <s:property value="#question.id" />
        </td>
        </tr>
        <tr>
        <td>
        <s:property value="#question.groupid" />
        </td>
        </tr>
        <tr>
        <td>
        <s:property value="#question.subgroupid" />
        </td>
        </tr>
        <tr>
        <td>
        <s:property value="#question.questiontxt" />
        </td>
        </tr>
        </s:iterator>
    </table>

        </body>
        </html>

欢迎
在这里输入代码

因此,我通过根据适当的java规范重命名变量来解决这个问题,即questiontxt列为String questiontxt,而不是String questiontxt

我需要一杯啤酒