代码如下:
<%@ 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里面的差不多,怎么效果差那么远的
<%@ 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里面的差不多,怎么效果差那么远的
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货