启动projectname-servlet.xml
来源:互联网 发布:java web 中文乱码 编辑:程序博客网 时间:2024/06/08 19:18
在spring工程中,当需要单独测试某一个services的功能时,可以不需要启动整个web工程,直接在main函数中启动projectname-servlet.xml,即可调用该services:
public static void main(String[] args) throws Exception{ ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath*:projectname-servlet.xml"); EventsService service = ctx.getBean(EventsService.class); EventflowParamDto dto = new EventflowParamDto(); dto.setUserId("1"); dto.setPage(0); dto.setSize(20); dto.setAlarmId("7"); dto.setGte_val("1499654928"); dto.setLte_val("1499654930"); dto.setInterval("100ms"); dto.setMin_val("1499654928"); dto.setMax_val("1499654930"); dto.setKeyWord(""); JsonObject jo = service.getEventFlow(dto); System.out.println(jo);}
阅读全文
0 0
- 启动projectname-servlet.xml
- tomcat启动报加载mvc-dispatcher-servlet.xml失败错误
- Servlet配置web.xml后 tomcat无法启动
- Servlet配置web.xml后导致无法启动Tomcat
- servlet通过web.xml配置在服务器启动时自动启动
- 新建servlet后tomcat启动不了,删除web.xml又可以启动
- web.xml中配置启动时加载的servlet,load-on-starup
- spring mvc 启动时报错Could not open ServletContext resource [/WEB-INF/appServlet-servlet.xml]
- iOS (ProjectName-info.plist) (ProjectName-Prefix.pch) 解析
- 介绍一下 servlet.xml
- springapp-servlet.xml
- web.xml-servlet config
- servlet和xml
- Servlet 和 XML
- web.xml -servlet
- Xml配置Servlet
- dispatcherServlet-servlet.xml 详细信息
- dispatcher-servlet.xml
- 多个 ul / ol (无序列表/有序列表)的嵌套时的重叠问题
- 杭电2018母牛的故事
- Nodejs实现WebSocket
- C语言:break和continue语句改变循环
- 列表生成式
- 启动projectname-servlet.xml
- git merge简介
- 驻极体麦和MEMS麦
- SVM 分类算法
- PHP非递归方式实现无限分类(转载)
- A poem
- 高清加载巨图方案-拒绝压缩图片
- Codeforces 827A/828C String Reconstruction[线段树单点更新]
- LeetCode: 35. Search Insert Position