软工博客21

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="model.Page" %>

<head> <title>政策列表</title> <style> body { font-family: Arial, sans-serif; margin: 20px; } .policy-list { margin-bottom: 20px; } .policy-item { padding: 8px 0; border-bottom: 1px solid #eee; } .pagination { margin-top: 20px; } .pagination a { margin: 0 5px; text-decoration: none; } .current-page { font-weight: bold; } </style> </head> <body> <h1>政策列表</h1>

<%
// 修改变量名
model.Page policyPage = (model.Page) request.getAttribute("policyPage");
if (policyPage == null || !policyPage.isConnected()) {
%>

数据库连接失败,请检查数据库配置。

<% } else { // 获取政策名称列表 List policyNames = policyPage.getData(); if (policyNames == null || policyNames.isEmpty()) { %>

没有可用的政策数据。

<% } else { %>
<% for (String name : policyNames) { %>
<%= name %>
<% } %>
<% } } %>
posted @ 2025-04-03 19:03  Thanatos。syts  阅读(6)  评论(0)    收藏  举报