먼저 Equinox 가 제공하는 템플릿 성격의 어플리케이션을 파악하고 나면 어떤 산출물이 필요한지 알 수 있고, 예제를 통해 배우는 식으로 따라하다보면 Spring 사용에 더욱 익숙해지리라 생각됩니다.
일단, 첫화면부터 추적을 해나가죠.
출발점이라고 할 수 있는 web.xml 파일을 먼저 살펴보죠. web.xml 전문은 저 아래 첨부합니다.
가장 먼저 보게 되는 페이지는 welcome-file-list 엘리먼트에 의해서 결정되죠.
관습을 깨지 않고 index.jsp로 했군요.
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
컨텍스트 리스너가 먼저 실행되겠지만 그건 차후에 관여된 것이 나타날 때 보도록 하고 index.jsp를 먼저 살펴보도록 하겠습니다.
------------------------------------------------------------------------------------------
<display-name>Equinox</display-name>
<!-- Define the basename for a resource bundle for I18N -->
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>messages</param-value>
</context-param>
<filter>
<filter-name>exportFilter</filter-name>
<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
</filter>
<filter>
<filter-name>messageFilter</filter-name>
<filter-class>org.appfuse.web.MessageFilter</filter-class>
</filter>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
<filter-mapping>
<filter-name>messageFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>exportFilter</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
</web-app>
|