ssm重新开发计科院新闻网站

ssm重新开发计科院新闻网站_第1张图片

ssm重新开发计科院新闻网站_第2张图片

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


  
    <base href="<%=basePath%>">
    
    西南石油大学-计算机科学学院
    "stylesheet" type="text/css" href="Style01.css">
    "stylesheet" type="text/css" href="css/Iframe.css" />
     
    
  
  
"a()">


"float:left;margin-left:10px">
"Select" method="get" class="add_cp">
"float:left;margin-left:20px">

class="add_cp">

"display: block; margin: 0 auto; width: 60%; background: #fff;">
class="divTop">
class="divSearch"> "text" placeholder="请输入关键词搜索"> "submit" value="搜索">
class="Guide">

"width:974px;height:970px;background-color:white;">
class="q">
class="q">
class="q">
class="q2" style="height:350px;">
class="p2">
class="t1"> 专题列表

"width:100%;height:70px;background-color:#224B77;color: white;text-align: center;line-height:70px;"> Copyright© 2018 All Rights Reserved. 西南石油大学计算机科学学院
index.jsp



"Content-Type" content="text/html; charset=utf-8" />
登录
"stylesheet" type="text/css" href="css/index.css" />


"background:#fff">
class="nav_top">
class="nav_tcon">
class="logoimg">"images/logo.png" />
class="logotitle"> 新闻后台

News

class="logoname">账号登录
class="logo_content">
class="logo_ccon"> class="logobei" src="images/logobei.png" />
"Login01" method="get">
class="logo_enter"> "border-bottom:solid 1px #cfcfcf">请使用工作账号进行登陆 登录名: class="use_name" type="text" name="uname" placeholder="tom" /> 登录密码:"index.html">忘记登录密码? class="use_password" type="password" name="upassword" placeholder="123" /> class="logo_ewm" src="images/ewm.png" />
class="down_info">
class="information"> "#">关于我们    "#">联系我们    "#">法律声明

新闻后台    厦门石脉科技

"font-size:12px">2015 Stonechat.com版权所有ICP证:鹭B2-22000000

"margin-top:5px" src="images/downbq.png" />
login.html
login.html
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

"-//W3C//DTD HTML 4.01 Transitional//EN">


"Content-Type" content="text/html; charset=utf-8" />
新闻管理
"stylesheet" type="text/css" href="css/Iframe.css" />
"stylesheet" href="utilLib/bootstrap.min.css" type="text/css" media="screen" />

  

class="cp_title">新闻管理


class="table_con"> class="tb_title">
"10%">ID "30%">新闻名 "26%">操作
"10%">${sessionScope.Imagenews0ID} "30%">${sessionScope.Imagenews0Name} "26%"> class="bj_btn" type="button" value="编辑" />
"Delete"> "hidden" name="newsid" value="${sessionScope.Imagenews0ID}"}> class="del_btn" type="submit" value="删除" />
"10%">${sessionScope.Imagenews1ID} "30%">${sessionScope.Imagenews1Name} "26%"> class="bj_btn" type="button" value="编辑" />
"Delete"> "hidden" name="newsid" value="${sessionScope.Imagenews1ID}"}> class="del_btn" type="submit" value="删除" />
"10%">${sessionScope.Imagenews2ID} "30%">${sessionScope.Imagenews2Name} "26%"> class="bj_btn" type="button" value="编辑" />
"Delete"> "hidden" name="newsid" value="${sessionScope.Imagenews2ID}"}> class="del_btn" type="submit" value="删除" />
"10%">${sessionScope.Imagenews3ID} "30%">${sessionScope.Imagenews3Name} "26%"> class="bj_btn" type="button" value="编辑" />
"Delete"> "hidden" name="newsid" value="${sessionScope.Imagenews3ID}"> class="del_btn" type="submit" value="删除" />
"10%">${sessionScope.Imagenews4ID} "30%">${sessionScope.Imagenews4Name} "26%"> class="bj_btn" type="button" value="编辑" />
"Delete"> "hidden" name="newsid" value="${sessionScope.Imagenews4ID}"> class="del_btn" type="submit" value="删除" />
"10%">${sessionScope.Imagenews5ID} "30%">${sessionScope.Imagenews5Name} "26%"> class="bj_btn" type="button" value="编辑" />
"Delete"> "hidden" name="newsid" value="${sessionScope.Imagenews5ID}"> class="del_btn" type="submit" value="删除" />
MyJsp.jsp
MyJsp.jsp
package com.b;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.a.DBHelper;
import com.a.NewsInfo;

@WebServlet("/Select")
public class Select extends HttpServlet {

    /**
         * The doGet method of the servlet. 
* * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred
*/ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //设置请求和响应的字符集编码 response.setContentType("text/html; charset=UTF-8"); request.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); //获得输出流 /* //数据库连接 DBHelper dbhelper=new DBHelper(); dbhelper.connect(); //执行6次查询 String[] newstime=new String[]{"imagenews","academicexchange","newsnow","partyactive","notice","spetiallist"}; for(int time=0;time newsall=dbhelper.myselect(); for(int i=0;i*/ for(int q=0;q<6;q++){ if(null!=request.getSession().getAttribute("Imagenews"+q+"ID")){ request.getSession().removeAttribute("Imagenews"+q+"ID"); request.getSession().removeAttribute("Imagenews"+q+"Name"); } } DBHelper dbhelper=new DBHelper(); dbhelper.connect(); String sql="select * from imagenews"; dbhelper.select(sql); List newsall=dbhelper.myselect(); for(int i=0;i){ NewsInfo Imagenews = newsall.get(i); request.getSession().setAttribute("Imagenews"+i+"ID", Imagenews.getId()); request.getSession().setAttribute("Imagenews"+i+"Name", Imagenews.getName()); } dbhelper.close(); response.sendRedirect("index.jsp"); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } } Select.java
Select.java

 

 

 

你可能感兴趣的:(ssm重新开发计科院新闻网站)