# jfrest(基于Jfinal的轻量级Rest服务框架) **Repository Path**: OCTD/jfrest ## Basic Information - **Project Name**: jfrest(基于Jfinal的轻量级Rest服务框架) - **Description**: Jfrest:基于Jfinal框架-Restful,服务框架,可以选择多种方式进行数据交互,JSON、XML等,与Jersey服务或者restlet服务,以及基于xml传输操作的服务相似。 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2017-12-04 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # jfrest(基于Jfinal的轻量级Rest服务框架) Jfrest:基于Jfinal框架-Restful,服务框架,可以选择多种方式进行数据交互,JSON、XML等,与Jersey服务或者restlet服务,以及基于xml传输操作的服务相似。 ## 启动类加载器定义示例: ``` /* * Copyright [2017] [Alex/LiBo(libo2dev.aliyun.com/alex.link@foxmail.com)] * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.libo.test; import net.alex.scan.annotation.IncludeAnnotations; import net.alex.scan.annotation.IncludePackages; /** * @Title BootStrapClassLoader.java * @Package com.libo.test * @Description 此类为总体启动类加载器的启动类:用于加载和初始化数据以及相关配置-总体入口 * 可以在此类上面定义自己的公共方法或者其他参数即可。 * @author LiBo/Alex * @date 2018年1月19日 * @version V1.0 */ @IncludeAnnotations @IncludePackages(packagePaths = {"com.libo.test"}) public final class BootStrapClassLoader { } ``` ## Restful接口类示例: ``` /* * Copyright [2017] [Alex/LiBo(libo2dev.aliyun.com/alex.link@foxmail.com)] * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.libo.test; import com.hyts.jfrest.annotation.core.REST; import com.hyts.jfrest.annotation.http.GET; import com.hyts.jfrest.annotation.message.JsonBody; import com.hyts.jfrest.annotation.mime.MediaType; import com.hyts.jfrest.restful.Rest; /** * @Title TestMethod.java * @Package com.libo.test * @Description TODO(用一句话描述该文件做什么) * @author LiBo/Alex * @date 2018年1月19日 * @version V1.0 */ @REST("/test2") public class TestMethod extends Rest{ @GET @MediaType public void test2() { TestObject param2 = new TestObject(); param2.id = "1"; param2.name = "2"; this.renderJson(param2); } } ``` ## web.xml文件配置示例: ``` bootstrapClass com.libo.test.BootStrapClassLoader ```