手写 Spring (4)

(11)示例实现类 TestXServiceImpl:

package com.xiaopengwei.demo.xservice.impl; import com.xiaopengwei.demo.xservice.ITestXService; import com.xiaopengwei.xspring.annotation.XService; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; /** * <p> * 业务实现类 * * @author XiaoPengwei * @since 2019-07-19 */ @XService public class TestXServiceImpl implements ITestXService { @Override public String listClassName() { // 假装来自数据库 return "123456TestXServiceImpl"; } }

(12)测试:

配置 Tomcat 后,访问:

:8080/test/query?username=xiaopengwei

:8080/test/listClassName

手写 Spring

手写 Spring

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpfwwz.html