Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
2betop committed Aug 11, 2014
1 parent f71498c commit 1ab8bf8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
13 changes: 12 additions & 1 deletion src/main/java/com/baidu/fis/velocity/spring/FisBean.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
package com.baidu.fis.velocity.spring;

import com.baidu.fis.velocity.util.Settings;
import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;

/**
* Created by 2betop on 8/11/14.
*/
public class FisBean {
public class FisBean implements ServletContextAware {

@Override
public void setServletContext(ServletContext servletContext) {
Settings.setApplicationAttribute(ServletContext.class.getName(), servletContext);
Settings.load(servletContext.getResourceAsStream(Settings.DEFAULT_PATH));
}
}
14 changes: 0 additions & 14 deletions web/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,10 @@
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet>
<servlet-name>velocity</servlet-name>
<servlet-class>com.baidu.fis.velocity.servlet.VelocityServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>velocity</servlet-name>
<url-pattern>*.vm</url-pattern>
Expand Down

0 comments on commit 1ab8bf8

Please sign in to comment.