1.hoyiweb是一个web项目的框架。分为hoyi-entities-java 与Javahoyi-webs 两个模块
HOYI Entities_Java 是实体与实体操作的模块。支持mysql,Redis,mongodb等。
它的git地址为:https://gitee.com/kuaifish/HOYI-Entities_Java.git
JavaHOYI-Web是web模块,包括api接口访问与web前端页面渲染。。
它的https://gitee.com/kuaifish/HOYI-Web.git
2.使用maven快速集成hoyi项目
![](https://i-blog.csdnimg.cn/blog_migrate/96c3c04ac522c24951cd724b5940c20c.png)
另外有一点需要注意的是Maven里面的版本号,例如:
2.1修改pom.xml和web.xml
在pom.xml中增加
<dependency>
<groupId>hoyi-webs</groupId>
<artifactId>hoyi-webs</artifactId>
<version>8.3</version>
</dependency>
修改web.xml
<servlet>
<description>runner dispatcher</description><display-name>runner dispatcher</display-name>
<servlet-name>DispatcherServlet</servlet-name>
<servlet-class>org.hoyi.dispatchs.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.hoyi.sessionlisten.SessionListenerCtrls</listener-class>
</listener>
2.2 增加文件目录与配置文件
在src/main/java 下增加 WebRoot目录,所有需要访问的类(接口或者界面)都需要写在这个目录底下。
在src/main下增加config文件夹,并增加hoyi.properties, hoyi.properties是hoyi的基础配置文件,如果不加该配置文件,则读取框架默认文件。( 这里需要配置属性Extions = .html)
3.编写测试类
在WebRoot目录底下新建DemoCtr.java类,继承Hoyipage,并编写test接口。代码如下:
ackage WebRoot;
import org.hoyi.dishop.Hoyipage;
import org.hoyi.wb.comment.RequestMode;
import org.hoyi.wb.comment.RequestType;
@RequestMode(MODE={RequestType.GET,RequestType.POST})
public class DemoCtr extends Hoyipage {
@RequestMode(MODE={RequestType.GET,RequestType.POST})
public void test(){
this.WriteUTF8HTML("hello world");
}
}
运行项目,在浏览器访问 ip:端口/项目/类路径?behavior=方法
在浏览器访问http://localhost:8085/hoyidemo/demo/DemoCtr.html?behavior=test
出现helloworld,则表示hoyi项目集成成功了。