• 大小: 18.02MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-05
  • 语言: 其他
  • 标签: SSH  项目  java  

资源简介

用 S S H 写的度假村项目 给朋友们分享一些资源 可用

资源截图

代码片段和文件信息

package cn.bdqn.controller;

import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cn.bdqn.services.IChatUserServices;

@Controller
@Transactional
public class ChatUserController extends HttpServlet{

@Autowired
private IChatUserServices iChatUserServices;

HttpSession session ;  
    ServletContext application;
    
    @RequestMapping(value=“/toLogin.html“)
 public String toLogin(HttpServletRequest requestModel model){  
        return “chatlogin“;  
   }
 
 @RequestMapping(value=“/login.html“method = RequestMethod.POST)  
    public void login(HttpServletRequest requestModel modelPrintWriter out){  
        String loginname = request.getParameter(“loginname“);  
        String password = request.getParameter(“password“);  
        String s = iChatUserServices.login(loginname password);
        System.out.println(“s为什么:“+s);
        session = request.getSession();  
        if(s==“success“){  
            session.setAttribute(“loginname“ loginname); // 保存当前登录的用户名  
            
            application = request.getSession().getServletContext();  
            if(application.getAttribute(“onLine“)==null){  
                application.setAttribute(“onLine“ ““);  
            }  
            String onLine = application.getAttribute(“onLine“).toString();  
            onLine +=loginname+“
“;  
            application.setAttribute(“onLine“ onLine);  
        }  
        //写入返回结果  
        out.write(s);  
    }  
      
    /** 
     * 控制跳转到聊天主界面 
     * @param request 
     * @param model 
     * @return 
     */  
    @RequestMapping(“/toChatMain.html“)  
    public String toChatMain(HttpServletRequest requestModel model){  
        return “chatMain“;  
    }  
      
    /** 
     * 前端发送聊天内容 
     * @param request 
     * @param model 
     */  
    @RequestMapping(“sentContent.html“)  
    public void sentContent(HttpServletRequest requestModel modelPrintWriter out){  
        //存储信息的全局变量  
        application = request.getSession().getServletContext();  
        session = request.getSession();  
        if(application.getAttribute(“message“)==null){  
            application.setAttribute(“message“ ““);  
        }  
        //获取application中存储的聊天内容  
        String sourceMessage = application.getAttribute(“message“).t

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       4679  2016-11-12 22:57  ssm3\.classpath

     文件       1112  2016-11-12 20:46  ssm3\.project

     文件        567  2016-11-12 19:23  ssm3\.settings\.jsdtscope

     文件        364  2016-11-12 19:23  ssm3\.settings\org.eclipse.jdt.core.prefs

     文件        619  2016-11-12 22:56  ssm3\.settings\org.eclipse.wst.common.component

     文件        345  2016-11-12 19:23  ssm3\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2016-11-12 19:23  ssm3\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2016-11-12 19:23  ssm3\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件        516  2016-11-12 20:58  ssm3\.springBeans

     文件       2672  2016-11-13 21:33  ssm3\build\classes\applicationContext.xml

     文件       4946  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\controller\ChatUserController.class

     文件      10521  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\controller\JMLoginController.class

     文件       3902  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\controller\SecCodeController.class

     文件        674  2016-11-13 16:59  ssm3\build\classes\cn\bdqn\dao\chatuser.xml

     文件        337  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\dao\IChatUserDao.class

     文件        483  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\dao\IRoleDao.class

     文件       1137  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\dao\IUserDao1.class

     文件       7352  2016-10-25 13:06  ssm3\build\classes\cn\bdqn\dao\mybatis-3-mapper.dtd

     文件       1207  2016-11-13 02:31  ssm3\build\classes\cn\bdqn\dao\roleMapper.xml

     文件       3998  2016-11-13 03:18  ssm3\build\classes\cn\bdqn\dao\userMapper.xml

     文件       1937  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\entity\Auth.class

     文件       2382  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\entity\JMUser.class

     文件        979  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\entity\PageBean.class

     文件       1417  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\entity\Role.class

     文件       3014  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\entity\User.class

     文件       2545  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\entity\User1.class

     文件       1517  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\services\ChatUserServices.class

     文件        364  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\services\IChatUserServices.class

     文件        522  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\services\IRoleServices.class

     文件       1140  2016-11-26 21:52  ssm3\build\classes\cn\bdqn\services\IUserServices1.class

............此处省略1137个文件信息

评论

共有 条评论