一个计算机技术爱好者与学习者

0%

项目简介

本文中,我们使用Mybatis+Spring+SpringMVC来完成一个迷你JavaWeb项目:用户管理系统。
功能:普通用户可以注册登录,管理员可以管理普通用户。

环境准备

安装jdk

参考《全平台安装JDK》

安装maven

下载地址: http://maven.apache.org/download.cgi

1、解压到自己喜欢的目录(这里郝同学放到D:\Server路径下)。
2、添加环境变量M2_HOME,值为D:\Server\apache-maven-3.3.9
3、在Path中添加;%M2_HOME%\bin;

打开命令提示符,输入mvn -v,如果能够看到maven版本号,说明安装成功。

安装tomcat

1、tomcat下载地址:http://tomcat.apache.org/download-80.cgi

2、假设解压目录为D:\Server\apache-tomcat-8.5.9

3、进入目录D:\Server\apache-tomcat-8.5.9\bin,双击startup.bat。

4、浏览器访问http://localhost:8080,启动成功则显示tomcat管理页面。

idea配置

idea配置参考《IDEA快捷键和配置》

新建Web项目

1、打开idea,File,New,Project,右边导航栏选择Maven,勾选Create from archetype,选择maven-archetype-webapp。

2、Next,输入GroupId为“com.voidking.pandawork”,输入ArtifactId为“pandawork-start”。

3、Next,选择自己安装的Maven中的User settings file,选择settings.xml中配置的Local repository。

4、Next,输入Project name,选择Project location,Finish。

5、稍等几十秒,Web项目便可以创建成功。

初始化项目结构

1、展开pandawork-start项目,展开src文件夹。

2、右键main文件夹,New,Directory,输入directory name为“java”。

3、右键main/java文件夹,New,Package,输入package name为“com.voidking.pandawork”。右键“com.voidking.pandawork”,新建文件README.md。

3、右键main/resources文件夹,New,Directory,输入directory name为“com.voidking.pandawork”。

3、至此,初始化项目结构完成。

阅读全文 »

前言

工欲善其事,必先利其器。IDEA作为当今最流行的IDE之一,有很多快捷键和配置可以帮助我们更好地开发。本文记录一下自己常用的一些快捷键和配置,备忘。

快捷键

查看快捷键

1、菜单栏,IntelliJ IDEA,Preferences…。
2、Keymap,Main menu,Refactor,Extract,Introduce Variable…。

自动补全函数返回值

windows: ctrl+alt+V,回车
macos: option+command+V,回车

函数跳转

command+单击,command+],command+[

代码格式化

macos: option+command+L

阅读全文 »

Supervisor简介

Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.

It shares some of the same goals of programs like launchd, daemontools, and runit. Unlike some of these programs, it is not meant to be run as a substitute for init as “process id 1”. Instead it is meant to be used to control processes related to a project or a customer, and is meant to start like any other program at boot time.

Supervisor是用Python开发的一套通用的进程管理程序,能将一个普通的命令行进程变为后台daemon,并监控进程状态,异常退出时能自动重启。它是通过fork/exec的方式把这些被管理的进程当作supervisor的子进程来启动,这样只要在supervisor的配置文件中,把要管理的进程的可执行文件的路径写进去即可。也实现当子进程挂掉的时候,父进程可以准确获取子进程挂掉的信息,可以选择是否自己启动和报警。supervisor还提供了一个功能,可以为supervisord或者每个子进程,设置一个非root的user,这个user就可以管理它对应的进程。

相关文档:

阅读全文 »