Skip to content

Commit 135bcd5

Browse files
committed
更新Readme
1 parent 89ba6c6 commit 135bcd5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ easy-httpserver
1010
目前项目已经能够完成一个动态网站的处理,并且采用类似jetty的嵌入启动方式,网站项目只需实现Controller和View页面并引入该项目jar包即可。
1111
已完成主要功能如下:
1212
<ul>
13-
<li>支持处理动态请求(后缀为do,请求路径restful风格)</li>
13+
<li>支持动态请求(后缀为do,请求路径restful风格)</li>
1414
<li>支持静态资源请求(后缀为对应资源类型后缀,可在配置文件中拓展)</li>
15-
<li>可通实现Controller接口处理动态请求,并支持配置文件和注解两种方式进行映射</li>
15+
<li>可通实现Controller接口处理动态请求,并支持注解方式进行映射</li>
1616
<li>动态请求可返回页面、json数据,并支持跳转</li>
1717
<li>整合Velocity,返回页面可通过Velocity语法渲染页面</li>
1818
<li>支持HTTP表单方式的文件上传(input:file)</li>
@@ -25,7 +25,7 @@ easy-httpserver项目内也有测试代码,可自行研究。这里介绍test-
2525
<li>1、clone easy-httpserver到本地,导入eclipse(已安装maven,编码utf-8)</li>
2626
<li>2、clone test-httpserver(示例项目)到本地,导入eclipse</li>
2727
<li>3、mvn install&nbsp;easy-httpserver(将jar导入test-httpserver,若配置maven则自动导),以下修改均在test-httpserver中</li>
28-
<li>2、按照注释修改test-httpserver配置文件<br />
28+
<li>4、按照注释修改test-httpserver配置文件<br />
2929
<div class="cnblogs_code">
3030
<pre><span style="color: #800000;">#包前缀
3131
PACKAGE_PREFIX=com.gj.web
@@ -46,16 +46,16 @@ controller.package=com.gj.web.controller
4646
#url/list=com.gj.web.controller.MyController</span></pre>
4747
</div>
4848
</li>
49-
<li>3、编写Controller类,需实现Controller接口,并返回ResultInfo对象(详情见示例)。在配置文件中添加映射(或使用注解)</li>
50-
<li>4、在配置文件指定文件夹(page:velocity文件,static:静态页面和资源)下编写对应页面</li>
51-
<li>5、mvn&nbsp;exec:java -Dexec.mainClass="org.eh.core.http.EHServer.Main" &nbsp;启动服务</li>
52-
<li>6、浏览器访问http://127.0.0.1:8888/list.do,即可看到结果</li>
49+
<li>5、编写Controller类,需实现Controller接口,并返回ResultInfo对象(详情见示例)。使用注解配置映射(如:http://127.0.0.1/test/path/show.do,配置controller为/test/path/,方法名为show)</li>
50+
<li>5、在配置文件指定文件夹(page:velocity文件,static:静态页面和资源)下编写对应页面</li>
51+
<li>6、mvn&nbsp;exec:java -Dexec.mainClass="org.eh.core.http.EHServer" &nbsp;启动服务</li>
52+
<li>7、浏览器访问http://127.0.0.1:8888/test/path/show.do,即可看到结果</li>
5353
</ul>
5454

5555
项目结构
5656
-----------------
5757
项目采用eclipse开发,并使用maven构建。
58-
<p><strong>~src/main/java</strong><br />&nbsp; <strong>--org.eh.core</strong><br />&nbsp; &nbsp;   <strong>--annotation</strong><br />&nbsp; &nbsp; &nbsp; &nbsp;    AnnocationHandler.java &nbsp; 注解处理类<br />&nbsp; &nbsp; &nbsp; &nbsp;    Controller.java &nbsp; &nbsp;Controller注解<br />&nbsp; &nbsp;<strong>   --common</strong><br />&nbsp; &nbsp; &nbsp; &nbsp;    Constants.java &nbsp; &nbsp;常量类,包括系统常量和配置文件对应信息<br />&nbsp; &nbsp; &nbsp; &nbsp;    ReturnType.java &nbsp; &nbsp;枚举,返回类型<br />&nbsp; &nbsp;   <strong>--http</strong><br />&nbsp; &nbsp; &nbsp; &nbsp;    EHHttpHandler.java &nbsp; &nbsp;httpserver请求核心处理类,完成请求的接收、处理、返回<br />&nbsp; &nbsp; &nbsp; &nbsp;    EHServer.java &nbsp; &nbsp;项目启动类,完成服务器启动<br />&nbsp; &nbsp;  <strong> --model</strong><br />&nbsp; &nbsp; &nbsp; &nbsp;    FileInfo.java &nbsp; &nbsp;上传文件信息封装<br />&nbsp; &nbsp; &nbsp; &nbsp;    ResultInfo.java &nbsp; &nbsp;Controller返回结果<br />&nbsp; &nbsp;  <strong> --util</strong><br />&nbsp; &nbsp; &nbsp; &nbsp;    FileUploadContentAnalysis.java &nbsp; &nbsp;上传请求解析类,从中提取表单中的域值和文件信息<br />&nbsp; &nbsp; &nbsp; &nbsp;    FileUtil.java &nbsp; 文件工具类<br />&nbsp; &nbsp; &nbsp; &nbsp;    IOUtil.java &nbsp; &nbsp;IO工具类<br />&nbsp; &nbsp; &nbsp; &nbsp;    PropertyUtil.java &nbsp; &nbsp;配置文件工具类<br />&nbsp; &nbsp; &nbsp; &nbsp;    StringUtil.java &nbsp; &nbsp;字符串工具类<br />&nbsp; &nbsp; &nbsp; &nbsp;    VelocityUtil.java &nbsp; &nbsp;Velocity工具类<br />&nbsp; &nbsp;   <strong>--web</strong><br />&nbsp; &nbsp; &nbsp;   <strong>&nbsp;--controller</strong><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;     Controller.java &nbsp; &nbsp;Controller接口,实现类必须实现process<br />&nbsp; &nbsp; &nbsp; &nbsp;  <strong>--view</strong><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;     ViewHandler.java &nbsp; &nbsp;View处理类,完成页面文件渲染<br /><strong>~src/main/resources</strong><br />   &nbsp;&nbsp;velocity.properties<br /><em id="__mceDel">   &nbsp;&nbsp;</em>web.properties</p>
58+
<p><strong>~src/main/java</strong><br />&nbsp; <strong>--org.eh.core</strong><br />&nbsp; &nbsp;   <strong>--annotation</strong><br />&nbsp; &nbsp; &nbsp; &nbsp;    AnnocationHandler.java &nbsp; 注解处理类<br />&nbsp; &nbsp; &nbsp; &nbsp;    Controller.java &nbsp; &nbsp;Controller注解<br />      &nbsp;RequestMapping &nbsp; &nbsp;请求方法注解,用来标注Controller中的处理方法<br />&nbsp; &nbsp;<strong>   --common</strong><br />&nbsp; &nbsp; &nbsp; &nbsp;    Constants.java &nbsp; &nbsp;常量类,包括系统常量和配置文件对应信息<br />&nbsp; &nbsp; &nbsp; &nbsp;    ReturnType.java &nbsp; &nbsp;枚举,返回类型<br />&nbsp; &nbsp;   <strong>--http</strong><br />&nbsp; &nbsp; &nbsp; &nbsp;    EHHttpHandler.java &nbsp; &nbsp;httpserver请求核心处理类,完成请求的接收、处理、返回<br />&nbsp; &nbsp; &nbsp; &nbsp;    EHServer.java &nbsp; &nbsp;项目启动类,完成服务器启动<br />&nbsp; &nbsp;  <strong> --model</strong><br />&nbsp; &nbsp; &nbsp; &nbsp;    FileInfo.java &nbsp; &nbsp;上传文件信息封装<br />&nbsp; &nbsp; &nbsp; &nbsp;    ResultInfo.java &nbsp; &nbsp;Controller返回结果<br />&nbsp; &nbsp;  <strong> --util</strong><br />&nbsp; &nbsp; &nbsp; &nbsp;    FileUploadContentAnalysis.java &nbsp; &nbsp;上传请求解析类,从中提取表单中的域值和文件信息<br />&nbsp; &nbsp; &nbsp; &nbsp;    FileUtil.java &nbsp; 文件工具类<br />&nbsp; &nbsp; &nbsp; &nbsp;    IOUtil.java &nbsp; &nbsp;IO工具类<br />&nbsp; &nbsp; &nbsp; &nbsp;    PropertyUtil.java &nbsp; &nbsp;配置文件工具类<br />&nbsp; &nbsp; &nbsp; &nbsp;    StringUtil.java &nbsp; &nbsp;字符串工具类<br />&nbsp; &nbsp; &nbsp; &nbsp;    VelocityUtil.java &nbsp; &nbsp;Velocity工具类<br />&nbsp; &nbsp;   <strong>--web</strong><br />&nbsp; &nbsp; &nbsp;   <strong>&nbsp;--controller</strong><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;     Controller.java &nbsp; &nbsp;Controller接口,实现类必须实现process<br />&nbsp; &nbsp; &nbsp; &nbsp;  <strong>--view</strong><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;     ViewHandler.java &nbsp; &nbsp;View处理类,完成页面文件渲染<br /><strong>~src/main/resources</strong><br />   &nbsp;&nbsp;velocity.properties<br /><em id="__mceDel">   &nbsp;&nbsp;</em>web.properties</p>
5959

6060
6161

0 commit comments

Comments
 (0)