Giter Site home page Giter Site logo

easychat's Introduction

easyChat

基于java servlet 和 WebSocket 的简易的网上聊天室。

项目构建

本项目使用Maven工具构建。

项目运行

Java版本

Java版本为18(不是最低版本),因为在pom.xml中配置了编译版本,需要用其他java版本,请修改pom.xml文件。

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <maven.compiler.source>you're java version</maven.compiler.source>
  <maven.compiler.target>you're java version</maven.compiler.target>
</properties>

Tomcat和Maven

需要用到Tomcat, 版本为9.0.65。

注意 因为Java EE 向 Eclipse基金会的转移,Java EE 所有实现的 API 的主要包已经从 javax.* 改为 jakarta.* 。如果需要使用Tomcat 10,请按照官方提供的工具进行迁移。

运行之前请保证IDEA中配置好Maven和Tomcat。

Redis

还需要Redis数据库。操作Redis使用jedis

Pom.xml 中引入方式如下:

  <!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
  <dependency>
    <groupId>redis.clients</groupId>
    <artifactId>jedis</artifactId>
    <version>4.2.3</version>
  </dependency>

本代码中使用JedisPool,其配置文件在src/main/resources/目录下。如需修改redis服务器地址,端口号和最大连接数等等参数,请修改jedisConfig.properties文件。

jedis.host = you're redis client host
jedis.port = you're redis client port
#最大连接数
jedis.maxTotal = 30
#最大空闲连接数
jedis.maxIdle = 10

参考资料

easychat's People

Contributors

jennier0107 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.