After tracing source code I find why 1.5.3 cannot recognise jsp files.
Spring boot 1.4.2
//org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.StoreMergedWebXmlListener#onStart
private void onStart(Context context) {
ServletContext servletContext = context.getServletContext();
if(servletContext.getAttribute("org.apache.tomcat.util.scan.MergedWebXml") == null) {
servletContext.setAttribute("org.apache.tomcat.util.scan.MergedWebXml", this.getEmptyWebXml());
}
TomcatResources.get(context).addClasspathResources(); // only 1.4.2 has this line
}
Spring boot 1.5.3
private void onStart(Context context) {
ServletContext servletContext = context.getServletContext();
if (servletContext.getAttribute(MERGED_WEB_XML) == null) {
servletContext.setAttribute(MERGED_WEB_XML, getEmptyWebXml());
}
}
And how to let spring boot 1.5.3 also work as 1.4.2? Below is my manner:
1.copy source code of TomcatEmbeddedServletContainerFactory
to your class path

2.modify onStart
method
private void onStart(Context context) {
ServletContext servletContext = context.getServletContext();
if (servletContext.getAttribute(MERGED_WEB_XML) == null) {
servletContext.setAttribute(MERGED_WEB_XML, getEmptyWebXml());
}
// add below code
List<URL> list = new ArrayList<>();
String file = "file:/Users/zhugw/workspace/boot-jar-serving-jsp/boot-jar-serving-jsp-1.0-SNAPSHOT.jar!/";
try {
URL jar = new URL("jar", null, file);
list.add(jar);
} catch (MalformedURLException e) {
e.printStackTrace();
}
TomcatResources.get(context).addResourceJars(list);
}