MVC模式在Java Web應用程序中的實例
阿新 • • 發佈:2017-05-06
simple handler hand resolv let handle 增加 獨立 efault
1.可用性
使用SimpleMappingExceptionResolver實現異常處理
只需要在Spring的配置文件applicationContext.xml中增加以下內容:
<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"> <property name="defaultErrorView" value="error"></property> <property name="exceptionAttribute" value="ex"></property> <property name="exceptionMappings"> <props> <prop key="com.core.exception.BusinessException">business_error</prop> <prop key="com.core.exception.ParameterException">parameter_error</prop> </props> </property> </bean>
2.可修改性
jsp界面的每一個功能對應後臺的函數,一個函數獨立的完成一個功能,由配置文件決定每個功能要執行的函數,當功能對應的操作發生改變時,只需要改變配置文件的指向就可以了。
3.性能
4.安全性
5.可測試性
6.易用性
MVC模式在Java Web應用程序中的實例