• 2021.4.10每日学习


    javaee学习构建spring框架

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%@page import="com.ch7.model.*"%>
    <%@page import="com.ch7.dal.Class"%>
    <%@page import="com.ch7.dal.Blog"%>
    <%@page import="com.ch7.common.DataValidator"%>
    <%@page import="com.ch7.common.Utility"%>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
                + path + "/";
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
    <%
        Blog blog = new Blog();
        List<BlogInfo> list = blog.getList(null);
        Class cls = new Class();
        List<ClassInfo> clist = cls.getList();
    %>
    </head>
    
    <body background="Image/timg.jpg" width=100% height=100%>
    
    <div class="header">
    <style>
    .header{ background:url(Image/2.jpg) no-repeat left top; height:618px;}}
    </style>
    
    </div>
        
        
        <div id="content">
            <%
                for (BlogInfo info : list) {
            %>
            <div class="post">
                <h1 class="title">
                    <a href="blog-information.jsp?id=<%=info.getId()%>"><%=info.getTitle()%></a>
                </h1>
                <p class="byline">
                    <small><%=info.getCreatedtime()%></small>
                </p>
                <div class="entry">
                    <p>
                        <%=Utility.Substring(DataValidator.removeHtml(info.getContext()), 300)%></p>
                </div>
                <p class="meta">
                    <a href="#" class="more">分类:<%=info.getClassName()%></a>&nbsp;&nbsp;&nbsp;<a
                        href="#" class="more">详情</a>&nbsp;&nbsp;&nbsp; <a
                        href="blog-information.jsp?id=<%=info.getId()%>#comment"
                        class="comments"> 我要评论</a>
                </p>
            </div>
            <%
                }
            %>
        </div>
    
        <div id="sidebar">
            <ul>
                <li>
                    <h2>日志分类</h2>
                    <ul>
                        <%
                            for (ClassInfo cinfo : clist) {
                        %>
                        <li><a href="blog-list.jsp?classId=<%=cinfo.getId()%>"><%=cinfo.getName()%></a></li>
                        <%
                            }
                        %>
                    </ul>
                </li>
            </ul>
        </div>
    </body>
    </html>
  • 相关阅读:
    【css】垂直居中的几种写法
    【gulp】gulp-file-include 合并 html 文件
    【gulp】gulp + browsersync 构建前端项目自动化工作流
    【nodejs】exports 和 module.exports 的区别
    【nodejs】初识 NodeJS(四)
    【nodejs】初识 NodeJS(三)
    【nodejs】初识 NodeJS(二)
    【nodejs】初识 NodeJS(一)
    【规范】前端编码规范——注释规范
    【规范】前端编码规范——jquery 规范
  • 原文地址:https://www.cnblogs.com/sunhongbin/p/14941133.html
Copyright © 2020-2023  润新知