There seems to be a conflict between the following:
1) New MVC namespace syntax:
<mvc:content-negotiation use-not-acceptable="true">
<mvc:default-views>
<bean class="org.springframework.web.servlet.view.JstlView">
<property name="url" value="" />
</bean>
</mvc:default-views>
</mvc:content-negotiation>
2) Inside my Unit test:
ResultActions actions =
this.mockMvc.perform(get("/vets.xml").accept(MediaType.TEXT_XML));
actions.andDo(print()); // action is logged into the console
actions.andExpect(status().isOk());
- Now using namespace, much simpler (11 lines instead of 27)
- Just a minor issue with:
<bean class="org.springframework.web.servlet.view.JstlView">
<property name="url" value="" />
</bean>
(should investigate later if we can remove “url” attribute
When java8 is used as default JDK the application throws exception when you try to access it.
Consider the following sequence:
1. java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
2. git clone https://github.com/komarevsky/spring-petclinic.git
3. cd spring-petclinic
4. mvn clean install
5. mvn tomcat7:run
6. open in browser "http://localhost:9966/petclinic/"
You will see the following:
HTTP Status 500 - Unable to compile class for JSP:
type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 1 in the generated java file
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:469)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
....
Changing tomcat7-maven-plugin version from 2.0 to 2.2 helps to fix it.
* The old datatables-servlet2 dependency has been removed from the pom.xml
* Some attributes have been renamed (e.g. paginate => pageable)
* Starting from the v0.10.0, all web components (servlet, filter) must be explicitely declared in the web.xml file. That's why I added the following declaration: DandelionFilter, DandelionServlet and DatatablesFilter
* Added a new datatables.properties file in order to disable the asset management brought by Dandelion-Core. This is equivalent to the old cdn=true table attribute