问题描述
我有一个应用程序,该应用程序应显示来自MysqL datbase的有关歌手的数据。但是,当我启动应用程序并打开浏览器时,除了$ {singer.firstName},$ {singer.lastName},$ {singer.birthDate}之外,什么都看不到。其他stackoverflow用户建议将isELIgnored更改为false并没有帮助。 JSPX页面看起来像这样
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:spring="http://www.springframework.org/tags" version="2.0">
<jsp:directive.page language="java" contentType="text/html;charset=UTF-8" isELIgnored="false"/>
<jsp:output omit-xml-declaration="yes"/>
<spring:message code="label_singer_list" var="labelSingerList"/>
<spring:message code="label_singer_first_name" var="labelSingerFirstName"/>
<spring:message code="label_singer_last_name" var="labelSingerLastName"/>
<spring:message code="label_singer_birth_date" var="labelSingerBirthDate"/>
<html>
<head><title>Title</title></head>
<body>
<h1>${labelSingerList}</h1>
<c:if test="${not empty singers}">
<table>
<thead>
<tr>
<th>${labelSingerFirstName}</th>
<th>${labelSingerLastName}</th>
<th>${labelSingerBirthDate}</th>
</tr>
</thead>
<tbody>
<c:forEach items="${singers}" var="singer">
<tr>
<td>${singer.firstName}</td>
<td>${singer.lastName}</td>
<td>${singer.birthDate}</td>
</tr>
</c:forEach>
</tbody>
</table>
</c:if>
</body>
</html>
</jsp:root>
消息代码用于国际化。由于我已经在没有它们的情况下测试了该应用程序,因此它们不会影响我获得的结果。
编辑: 我已经根据http://www.hs-augsburg.de/homes/meixner/saj/skript/architektursichten/examples/roodemo/pizza/src/main/webapp/WEB-INF/views/base/list.jspx更改了jspx页面的内容,但遇到了新的错误。每次启动该应用程序并登录时,都会收到消息,该XML文件似乎没有与之关联的任何样式信息。文档树如下所示。程序本身的逻辑未更改。这是新内容
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<div xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags" version="2.0">
<jsp:directive.page contentType="text/html; charset=UTF-8" isELIgnored="false"/>
<jsp:output omit-xml-declaration="yes"/>
<spring:message code="label_singer_list"
var="labelSingerList"/>
<spring:message code="label_singer_first_name"
var="labelSingerFirstName"/>
<spring:message code="label_singer_last_name"
var="labelSingerLastName"/>
<spring:message code="label_singer_birth_date"
var="labelSingerBirthDate"/>
<h1>${labelSingerList}</h1>
<c:if test="${not empty singers}">
<table>
<thead>
<tr>
<th>${labelSingerFirstName}</th>
<th>${labelSingerLastName}</th>
<th>${labelSingerBirthDate}</th>
</tr>
</thead>
<tbody>
<c:forEach items="${singers}" var="singer">
<tr>
<td>${singer.firstName}</td>
<td>${singer.lastName}</td>
<td>${singer.birthDate}</td>
</tr>
</c:forEach>
</tbody>
</table>
</c:if>
</div>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)