struts1和Velocity整合

1.导入struts运行所需的jar文件和Velocity运行所需的jar文件

另外需要commons-collections-3.2.1.jar,commons-lang-2.4.jar,oro-2.0.8.jar

2.在web.xml中配置strus的核心Actionservlet:

   <span style="white-space:pre">				</span><span style="font-size:18px;"><!-- 配置Struts1的配置 -->
  <span style="white-space:pre">	</span><servlet>
  <span style="white-space:pre">		</span><servlet-name>action</servlet-name>
  <span style="white-space:pre">		</span><servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
  <span style="white-space:pre">		</span><init-param>
  <span style="white-space:pre">			</span><!-- 配置struts配置文件的路径  -->
  <span style="white-space:pre">			</span><param-name>config</param-name>
  <span style="white-space:pre">			</span><param-value>/WEB-INF/classes/struts-config.xml</param-value>
  <span style="white-space:pre">		</span></init-param>
  <span style="white-space:pre">		</span><load-on-startup>0</load-on-startup>
  <span style="white-space:pre">	</span></servlet>
  <span style="white-space:pre">	</span>
  <span style="white-space:pre">	</span><servlet-mapping>
  <span style="white-space:pre">		</span><servlet-name>action</servlet-name>
  <span style="white-space:pre">		</span><url-pattern>*.do</url-pattern>
  <span style="white-space:pre">	</span></servlet-mapping></span></span></span>
<span style="font-size:18px;">
</span>
<span style="font-size:24px;">3.在web.xml中配置Velocity的配置:
</span>
 
 
 
 
 
 

















你可能感兴趣的:(struts1和Velocity整合)