随笔分类 -  Spring Mvc

摘要:bean 配置文件属性 init-method 用于在bean初始化时指定执行方法,用来替代继承 InitializingBean接口。相关链接:https://www.cnblogs.com/JoeyWong/p/9304737.html 测试程序如下: 配置文件如下: Main主程序如下: 打印 阅读全文
posted @ 2019-07-01 14:31 DarJeely 阅读(2066) 评论(0) 推荐(0)
摘要:1、使用构造子注入时,则使用constructor-arg子标签,来指定构造函数的参数。 <bean id="provider" class="com.apress.prospring.ch4.ConfigurableMessageProvider"> <constructor-arg> <valu 阅读全文
posted @ 2019-07-01 14:26 DarJeely 阅读(4152) 评论(0) 推荐(0)
摘要:前言: 使用springMvc已经三年了,但是内部原来一直不太了解,看到ServletConetxt和ApplicationContext头就大,趁着这几天学习,正好学习下相关的知识。 1.ServletContext 首先我们说到ServletContext,ServletContext是一个We 阅读全文
posted @ 2019-06-20 12:49 DarJeely 阅读(1688) 评论(0) 推荐(0)
摘要:1:web.xml:web应用一经加载,先来找他 1):指明applicationContext的位置 2):引入spring监听,ContextLoaderListener,这样启动web容器时,会自动装配applicaiontContext的配置信息 3):配置springmvc的前端控制器Di 阅读全文
posted @ 2019-06-20 12:03 DarJeely 阅读(799) 评论(0) 推荐(0)
摘要:1、高版本选择bling版本,低版本选择profession版本2、用高版本的公钥替换低版本的公钥3、先破解低版本的后破解高版本的4、最后用高版本的替换低版本的文件 阅读全文
posted @ 2019-05-26 17:59 DarJeely 阅读(482) 评论(0) 推荐(0)
摘要:一、前言 编码时我们总会发现如下变量未被使用的警告提示: 上述代码编译通过且可以运行,但每行前面的“感叹号”就严重阻碍了我们判断该行是否设置的断点了。这时我们可以在方法前添加 @SuppressWarnings("unused") 去除这些“感叹号”。 二、 @SuppressWarings注解 作 阅读全文
posted @ 2019-05-13 16:15 DarJeely 阅读(199) 评论(0) 推荐(0)
摘要:一、HttpServletRequest介绍 HttpServletRequest对象代表客户端的请求,当客户端通过HTTP协议访问服务器时,HTTP请求头中的所有信息都封装在这个对象中,通过这个对象提供的方法,可以获得客户端请求的所有信息。 二、Request常用方法 2.1、获得客户机信息 ge 阅读全文
posted @ 2019-05-13 16:01 DarJeely 阅读(520) 评论(0) 推荐(0)
摘要:Spring MVC 向页面传值-Map、Model和ModelMap 除了使用ModelAndView方式外。还可以使用Map、Model和ModelMap来向前台页面创造 使用后面3种方式,都是在方法参数中,指定一个该类型的参数。例如: Java代码 1 @RequestMapping("/te 阅读全文
posted @ 2019-05-13 15:00 DarJeely 阅读(459) 评论(0) 推荐(0)
摘要:ModelAndView 该对象中包含了一个model属性和一个view属性 model:其实是一个ModelMap类型。其实ModelMap是一个LinkedHashMap的子类 view:包含了一些视图信息 当视图解释器解析ModelAndVIew是,其中model本生就是一个Map的实现类的子 阅读全文
posted @ 2019-05-13 14:56 DarJeely 阅读(885) 评论(0) 推荐(0)
摘要:本文原文连接: http://blog.csdn.net/bluishglc/article/details/7596118 ,转载请注明出处! 有时候你会发现过去一直启动正常的系统,某天启动时会报出形如下面的错误: org.xml.sax.SAXParseException: schema_ref 阅读全文
posted @ 2019-05-05 11:29 DarJeely 阅读(381) 评论(0) 推荐(0)
摘要:HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); ServletContext context = request.getSession().getServletContext(); ApplicationC... 阅读全文
posted @ 2019-05-05 11:16 DarJeely 阅读(264) 评论(0) 推荐(0)
摘要:1 . RequestContextHolder 的使用 想要使用RequestContextHolder,要在web.xml中配置RequestContextListener的监听才能使用。 同时 这样可以获取request和response。 2 . HandlerInterceptorAdap 阅读全文
posted @ 2019-05-05 11:14 DarJeely 阅读(604) 评论(0) 推荐(0)
摘要:获取request对象: 首先配置web.xml文件--> [html] view plaincopy <listener> <listener-class> org.springframework.web.context.request.RequestContextListener </liste 阅读全文
posted @ 2019-05-05 11:14 DarJeely 阅读(787) 评论(0) 推荐(0)
摘要:原因是因为单元测试时没有加载 web.xml 中的: 所以单元测试时如果需要用到 request 中的值的话,就用静态测试数据测试就好了~ 阅读全文
posted @ 2019-05-05 11:13 DarJeely 阅读(3345) 评论(0) 推荐(0)
摘要:org.springframework.web.servlet.support.RequestContextUtils 在spring-webmvc中, 主要用来获取WebApplicationContext org.springframework.web.context.request.Reque 阅读全文
posted @ 2019-05-05 11:12 DarJeely 阅读(570) 评论(0) 推荐(0)
摘要:转载: http://blog.csdn.net/lexang1/article/details/52619215 在使用spring时,经常需要在普通类中获取session,request等对像.比如一些AOP拦截器类,在有使用struts2时,因为struts2有一个接口使用org.apache 阅读全文
posted @ 2019-05-05 11:11 DarJeely 阅读(908) 评论(0) 推荐(0)
摘要:JShop简介:jshop是一套使用Java语言开发的B2C网店系统,致力于为个人和中小企业提供免费、好用的网店系统。 项目主页:http://git.oschina.net/dinguangx/jshop 在线演示: 前台: http://jshop.ofmall.org:81/jshop 后台: 阅读全文
posted @ 2019-05-05 11:10 DarJeely 阅读(1612) 评论(0) 推荐(0)
摘要:版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/aiyaya_/article/details/78975893前言在开发spring web项目时,我们很多的Controller层代码都需要获取一下,HttpServletRequest、HttpS 阅读全文
posted @ 2019-05-05 11:09 DarJeely 阅读(840) 评论(0) 推荐(0)
摘要:版权声明:随意转载,注明出处 https://blog.csdn.net/River_Continent/article/details/77511389后台传参,一直是一个比较重要的地方,如果涉及Web,我们可以用RequestContext来帮我们传递参数,即使在不同的页面,不用的方法,只要没有 阅读全文
posted @ 2019-05-05 11:08 DarJeely 阅读(11105) 评论(0) 推荐(0)
摘要:以下的 request 实例都编号了,一共 4 种 方式 1.@Autowired 方式2.public void Test(HttpServletRequest request1, HttpServletResponse resp,HttpSession session1) 方式3.((Servl 阅读全文
posted @ 2019-05-05 11:07 DarJeely 阅读(5999) 评论(0) 推荐(0)