springframeworkのxmlファイルの読み込みどこでしてんだろうか?
どこでXMLファイル名指定して見込んでんだよとかおもったんでgrepしてみた。
収集
cd spring-framework-3.1.0.M1/projects grep xml **/*.java | grep -v Test | grep WEB-INF | perl hoge.pl | sort -u
1 use strict; 2 3 while(my $row = <>) { 4 chomp $row; 5 my ($file,@others) = split(/\s+/,$row); 6 7 my $string = join(' ',@others); 8 9 if( $string =~ m{(/WEB-INF/.+\.xml)} ) { 10 print $1 . "\n"; 11 } 12 }
結果
なんかpatternとか書いてあるからそのへん漁れればいけるはず。
/WEB-INF/"forthepattern"/WEB-INF/*.xml /WEB-INF/*-context.xml /WEB-INF/action-servlet.xml /WEB-INF/action-servlet.xml /WEB-INF/myContext.xml /WEB-INF/applicationContext.xml /WEB-INF/context.xml /WEB-INF/defs/administrator.xml /WEB-INF/defs/customer.xml /WEB-INF/defs/general.xml /WEB-INF/defs/templates.xml /WEB-INF/defs/widgets.xml /WEB-INF/ehcache.xml /WEB-INF/hello-world-portlet-config.xml /WEB-INF/mapping/example.hbm.xml /WEB-INF/sessionContext.xml /WEB-INF/struts-config.xml /WEB-INF/test-portlet.xml /WEB-INF/test-servlet.xml /WEB-INF/tiles.xml /WEB-INF/toolbox.xml /WEB-INF/views.xml
for the pattern出さがした結果
ちょっと違った。
358 /** 359 * Determine the root directory for the given location. 360 * <p>Used for determining the starting point for file matching, 361 * resolving the root directory location to a <code>java.io.File</code> 362 * and passing it into <code>retrieveMatchingFiles</code>, with the 363 * remainder of the location as pattern. 364 * <p>Will return "/WEB-INF/" for the pattern "/WEB-INF/*.xml", 365 * for example. 366 * @param location the location to check 367 * @return the part of the location that denotes the root directory 368 * @see #retrieveMatchingFiles 369 */ 370 protected String determineRootDir(String location) { 371 int prefixEnd = location.indexOf(":") + 1; 372 int rootDirEnd = location.length(); 373 while (rootDirEnd > prefixEnd && getPathMatcher().isPattern(location.substring(prefixEnd, rootDirEnd))) { 374 rootDirEnd = location.lastIndexOf('/', rootDirEnd - 2) + 1; 375 } 376 if (rootDirEnd == 0) { 377 rootDirEnd = prefixEnd; 378 } 379 return location.substring(0, rootDirEnd); 380 }
SimpleFormControllerがDeprecatedになってる
Deprecated. as of Spring 3.0, in favor of annotated controllers @Deprecated public class SimpleFormController