spring
安小平
诚实勤劳,认真细心有耐性,学习能力强
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
SpringBoot 中设置项目的访问路径及端口
版本在 2.0 以下的和 2.0 以上 的设置有区别2.0 以上版本设置: 需要添加一级 servlet , 不加这个默认为 '/ ’ yml方式: server: port:8088 servlet: context-path:/springboot properties方式: server.port:8088 server.servlet.context-path:/springboot 版本 2.0 以下的: 不加 servlet yml方式: server原创 2021-07-05 13:56:01 · 604 阅读 · 0 评论 -
普通Java类获取Spring的ApplicationContext
在SSH集成的前提下。某些情况我们需要在Action以外的类中来获得SPRing所管理的Service对象。 之前我在网上找了好几好久都没有找到合适的方法。例如: ApplicationContext context = new ClassPathXmlApplicationContext(); 当时我觉得没有这个必要,浪费内存。后来我终于想出了一个解决方法。在此拿来给大家参转载 2015-09-06 16:50:12 · 380 阅读 · 0 评论
分享