DispatcherServlet
1。初始化默認配置
?private static final String DEFAULT_STRATEGIES_PATH = "DispatcherServlet.properties";
static {
??// Load default strategy implementations from properties file.
??// This is currently strictly internal and not meant to be customized
??// by application developers.
??try {
???ClassPathResource resource = new ClassPathResource(DEFAULT_STRATEGIES_PATH, DispatcherServlet.class);
???InputStream is = resource.getInputStream();
???try {
????defaultStrategies.load(is);
???}
???finally {
????is.close();
???}
??}
??catch (IOException ex) {
???throw new IllegalStateException("Could not load 'DispatcherServlet.properties': " + ex.getMessage());
??}
?}
DispatcherServlet.properties 里面內容為:
org.springframework.web.servlet.LocaleResolver=org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver
org.springframework.web.servlet.ThemeResolver=org.springframework.web.servlet.theme.FixedThemeResolver
org.springframework.web.servlet.HandlerMapping=org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
org.springframework.web.servlet.HandlerAdapter=org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,\
?org.springframework.web.servlet.mvc.throwaway.ThrowawayControllerHandlerAdapter
org.springframework.web.servlet.ViewResolver=org.springframework.web.servlet.view.InternalResourceViewResolver
可以看出如果沒有相應的配置,DispatcherServlet就會調用默認設置
posted @
2006-06-23 10:03 Dragonofson 閱讀(2026) |
評論 (0) |
編輯 收藏
<form?name="form1"?action=""?method="post">
<select?name="s1">
????<option?value="aa">aaaaa</option>
????<option?value="bb">bbbb</option>
????<option?value="cc">ccccc</option>
????<option?value="dd">dddd</option>
????<option?value="ee">eeee</option>
</select>
</form>
假設在修改頁面時,s1的值是dd,那么默認應該選中的是dddd這個option,那我們可以用如下的JS代碼來實現:
<script?language="JavaScript">
<!--
for?(i=0;i<document.form1.s1.options.length;i++)
{?
?????if(document.form1.s1.options[i].value=="<%=Rs("xxxxx")%>")
?????{
?????????document.form1.s1.options[i].selected=true;break;
?????}?
}
//-->
</script>
<%=Rs("xxxxx")%>的值為dd
posted @
2006-06-22 10:37 Dragonofson 閱讀(813) |
評論 (1) |
編輯 收藏
最近在研究Spring MVC框架~發現一個問題.
根據源碼的實例:
It is named based on the servlet-name from web.xml with '-servlet' appended. This is a standard naming convention used in the Spring Framework
那么配置文件不就是只能有一個了嗎?那么要是在大型的系統里面,Control很多的情況下。這個文件不回冗余嗎?調試不好調試,找bean 也不好找。那要怎么樣才能配置多個配置文件了????
posted @
2006-06-21 11:35 Dragonofson 閱讀(973) |
評論 (1) |
編輯 收藏