1、创建一个test.jsp 映入css样式文件
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set> 设定工程路径
<link rel="stylesheet" type="text/css" href="${contextPath}/extjs/resources/css/ext-all.css"/>
2、引入一个重要的js文件,4个文件选一个即可
<script type="text/javascript" charset="utf-8" src="${contextPath}/extjs/ext-all-debug.js" />
<script type="text/javascript" charset="utf-8" src="${contextPath}/extjs/ext-all-dev.js" />
<script type="text/javascript" charset="utf-8" src="${contextPath}/extjs/bootstrap.js" />
<script type="text/javascript" charset="utf-8" src="${contextPath}/extjs/ext-all.js" />
3、引入国际化js
<script type="text/javascript" charset="utf-8" src="${contextPath}/extjs/ext-lang-zh_CN.js"/>
4 引入自己的js
<script type="text/javascript" charset="utf-8" src="${contextPath}/js/test.js"/>
需要注意的是如果使用了springmvc 需要配置资源文件的映射
<mvc:resources location="/extjs/" mapping="/extjs/**"/>
<mvc:resources location="/js/" mapping="/js/**"/>
<mvc:resources location="/jsp/" mapping="/jsp/**"/>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>test.jsp</title> <link rel="stylesheet" type="text/css" href="${contextPath}/extjs/resources/css/ext-all.css"/> <script type="text/javascript" charset="utf-8" src="${contextPath}/extjs/ext-all-debug.js" /> <script type="text/javascript" charset="utf-8" src="${contextPath}/extjs/ext-lang-zh_CN.js"/> <script type="text/javascript" charset="utf-8" src="${contextPath}/js/test.js"/> </head> <body> </body> </html>