架构师之路(一)
作为一名软件开发人员,成为架构师是追求之一。系统架构师的能力不仅仅体现在书写业务代码上,更重要的是系统的结构和性能,是否具有可拓展性、高并发性和稳定性。
比如:
<!-- spring配置文件位置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring.xml</param-value>
</context-param>
表示的就是上下文参数,contextConfigLocation的值为classpath*:spring.xml。
现在java软件开发,主要的是使用spring mvc框架,spring mvc配置也需要在web.xml里面进行配置描述,具体配置如下:
<!--spring mvc 配置 -->
<servlet>
<servlet-name>springMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
所有的请求,都会经过DispatcherServlet,所带的上下文参数为contextConfigLocation值为classpath:spring-mvc.xml。
这样就是web.xml的基本信息。
作为一名软件开发人员,成为架构师是追求之一。系统架构师的能力不仅仅体现在书写业务代码上,更重要的是系统的结构和性能,是否具有可拓展性、高并发性和稳定性。
下面谈谈软件项目的架构心得。
比如:
<!-- spring配置文件位置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring.xml</param-value>
</context-param>
表示的就是上下文参数,contextConfigLocation的值为classpath*:spring.xml。
现在java软件开发,主要的是使用spring mvc框架,spring mvc配置也需要在web.xml里面进行配置描述,具体配置如下:
<!--spring mvc 配置 -->
<servlet>
<servlet-name>springMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
所有的请求,都会经过DispatcherServlet,所带的上下文参数为contextConfigLocation值为classpath:spring-mvc.xml。
这样就是web.xml的基本信息。