February 2015
Intermediate to advanced
178 pages
3h 47m
English
This section will mock the request and session scope beans with MockHttpServletRequest and MockHttpSession:
SpringWebTest, add the Spring-mvc jars to the classpath, and modify the web.xml file (stored under <project>/WebContent/WEB-INF/) to enable Spring DispatcherServlet as follows:<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>SpringWebTest</display-name> <servlet> <servlet-name>dispatcher</servlet-name> ...
Read now
Unlock full access