代码如下:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link rel="stylesheet" type="text/css" href="resources/css/ext/ext-all.css"/>
<script type="text/javascript" src="resources/js/ext/ext-base.js"></script>
<script type="text/javascript" src="resources/js/ext/ext-all.js"></script>
<script type="text/javascript" src="resources/js/index.js"></script>
  </head>
  
  <body>
    dsf
  </body>
</html>
index.js:Ext.onReady(function(){

Ext.QuickTips.init();

Ext.form.Field.prototype.msgTarget='side';

var loginForm = new Ext.FormPanel({
standardSubmit:true,
        labelWidth: 75, // label settings here cascade unless overridden
        frame:true,
        title: '',
        bodyStyle:'padding:5px 5px 0',
        width: 350,
        defaults: {width: 230},
        defaultType: 'textfield',        items: [{
             id:'username',
                fieldLabel: 'User',
                name:'username',
                allowBlank:false,
                blankText:'User can`t be blank!!'
            },{
             id:'password',
                fieldLabel: 'Password',
                name: 'password',
                allowBlank:false,
                blankText:'User can`t be blank!!',
                inputType:'password'
            }
        ],        buttons: [{
            text: 'Login',
            handler:loginSubmit
        },{
            text: 'Canel',
            handler:formReset
        }]
    });    function loginSubmit(){
     loginForm.getForm().getEl().dom.action='loginAction';
     loginForm.getForm().submit();
    }
    
    function formReset(){
     loginForm.getForm().reset();
    }
    
    loginForm.render(document.body);

});我做的跟samples里面的差不多,怎么效果差那么远的

解决方案 »

  1.   

    ext-all.css这个路径 不正确
      

  2.   

    我正确导入了啊,Firefox上面都有显示
      

  3.   

    不过我只是把extjs文件夹里面的ext-all.js ,ext-all.css和ext-base.js 复制到我的项目里面 
      

  4.   

    不要改变 Ext中css的文件存放的层次,因为css中的图片用的是相对路径,你换了地方就找不到图片了啊
      

  5.   

    所以我要把整个ext文件夹copy到我的项目里面?还是只是resources这个文件夹
      

  6.   

    终于解决了我把resources那个文件夹copy到我的项目里面,没有改到里面文件的相对路径。3q