日期:2014-05-16  浏览次数:20461 次

Struts2+Spring2.5+ibatis+ExtJS3.1 基于注解框架搭建(5)
1、BaseService
public class BaseService
{
    /**
     * 返回日志对象
     *
     * @return
     * @see [类、类#方法、类#成员]
     */
    protected Logger getLog()
    {
        return Logger.getLogger(BaseAction.class);
    }
}

2、创建页面
login.jsp
<%@ page language="java"  pageEncoding="GBK"%>
<html>
<head>
    <title>Custom Layouts and Containers - Login Example</title>

    <!-- ** CSS ** -->
    <!-- base library -->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/extjs3.1/resources/css/ext-all.css" />

    <!-- ** Javascript ** -->
    <!-- ExtJS library: base/adapter -->
    <script type="text/javascript" src="${pageContext.request.contextPath}/extjs3.1/adapter/ext/ext-base.js"></script>

    <!-- ExtJS library: all widgets -->
    <!--
    <script type="text/javascript" src="${pageContext.request.contextPath}/extjs3.1/ext-all.js"></script>
     -->
    <script type="text/javascript" src="${pageContext.request.contextPath}/extjs3.1/ext-all-debug.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/extjs3.1/ext-lang-zh_CN.js" charset="utf-8"></script>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/login/login.js"></script>

</head>
<body>
<div id="loginPanel" align="center"></div>
</body>
</html>


login.js

/*!
* Ext JS Library 3.1.1
* Copyright(c) 2006-2010 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.onReady(function() {
Ext.QuickTips.init();   //用于消息提示
    Ext.form.Field.prototype.msgTarget = 'side'; 
   
    var loginForm = new Ext.form.FormPanel({
        baseCls: 'x-plain',
        layout:'absolute',
        defaultType: 'textfield',

        items: [{
            x: 0,
            y: 5,
            xtype:'label',
            text: 'StaffNo:'
        },{
            x: 60,
            y: 0,
            name: 'staffId',
            anchor:'100%',  // anchor width by percentage
            allowBlank: false,  
            blankText: 'StaffNo is not null'
        },{
            x: 0,
        &nb