锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品亚洲一区二区
,91精品啪在线观看国产手机,黄色大片在线看http://www.aygfsteel.com/zh-qi/category/32744.html涓鍒囦粠澶村紑濮?/description>zh-cnThu, 10 Jul 2008 10:01:02 GMTThu, 10 Jul 2008 10:01:02 GMT60- 琛ㄥ崟閿欒淇℃伅鐨勬樉紺?/title>http://www.aygfsteel.com/zh-qi/archive/2008/07/10/213948.html絎戠湅椋庝簯絎戠湅椋庝簯Thu, 10 Jul 2008 06:05:00 GMThttp://www.aygfsteel.com/zh-qi/archive/2008/07/10/213948.htmlhttp://www.aygfsteel.com/zh-qi/comments/213948.htmlhttp://www.aygfsteel.com/zh-qi/archive/2008/07/10/213948.html#Feedback0http://www.aygfsteel.com/zh-qi/comments/commentRss/213948.htmlhttp://www.aygfsteel.com/zh-qi/services/trackbacks/213948.html
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<html>
<head>
<title>login</title>
</head>
<body>
<html:form action="/login">
<html:errors property="handle"/><br/>
username : <html:text property="username"/><html:errors property="username"/><br/>
password : <html:password property="password"/><html:errors property="password"/><br/>
<html:submit/><html:cancel/>
</html:form>
</body>
</html>
2.loginAction

/**//*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.my.struts.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.Globals;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

import com.my.struts.form.LoginForm;


/** *//**
* MyEclipse Struts
* Creation date: 06-18-2008
*
* XDoclet definition:
* @struts.action path="/login" name="loginForm" input="/form/login.jsp" scope="request" validate="true"
* @struts.action-forward name="ok" path="/login/login_suc.jsp"
*/

public class LoginAction extends Action
{

/**//*
* Generated Methods
*/


/** *//**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,

HttpServletRequest request, HttpServletResponse response)throws Exception
{
LoginForm loginForm = (LoginForm) form;// TODO Auto-generated method stub
String username=loginForm.getUsername();
String password=loginForm.getPassword();
if(username.equals("admin")&&password.equals("111111"))
return mapping.findForward("ok");
//--------------------------------------------------------------------------------
//絎竴縐嶆柟娉?/span>
ActionErrors errors=new ActionErrors();
ActionMessage msg;
msg=new ActionMessage("login.failed");
errors.add("handle",msg);
saveErrors(request, errors);
//--------------------------------------------------------------------------------
//絎簩縐嶆柟娉?鎶妉ogin.jsp涓?lt;html:errors property="handle"/><br/>鏀逛負<html:errors /><br/>)
// ActionMessages msg=this.getMessages(request);
// msg.add(Globals.ERROR_KEY, new ActionMessage("login.failed2"));
// this.addErrors(request, msg);
//--------------------------------------------------------------------------------
return mapping.getInputForward();
}
}
3.ApplicationResources.properties
# Resources for parameter 'com.my.struts.ApplicationResources'
# Project MessageTest
login.failed=<font color="#FF0044">閿欒鐨勭敤鎴峰悕鎴栧瘑鐮?/span></font>
login.failed2=<font color="#FF0044">鍑洪敊鍟?/span>!</font>
褰撶劧鍟?涔熷彲浠ヨ兘榪噇oginform閲岀殑validate鏉ュ疄鐜?
ActionErrors errors = new ActionErrors(); // create ActionErrors instance
ActionMessage msg;
if (username==null||username.length() < 1) {
msg = new ActionMessage("error.notnull", username);
errors.add("username", msg);
}
if (password==null||password.length() < 1) {
msg = new ActionMessage("error.notnull", password);
errors.add("password", msg);
}
return errors;

]]>
主站蜘蛛池模板:
醴陵市|
东光县|
潜山县|
潼南县|
双流县|
富锦市|
武安市|
南阳市|
五寨县|
建昌县|
嘉兴市|
建宁县|
繁昌县|
沁阳市|
赤壁市|
凭祥市|
钟山县|
东兴市|
邻水|
宣城市|
卢龙县|
开阳县|
浙江省|
兴和县|
西吉县|
田阳县|
清徐县|
宜都市|
桦南县|
洛扎县|
余姚市|
泸州市|
西青区|
肥西县|
宜昌市|
兰州市|
西安市|
客服|
正镶白旗|
荆门市|
招远市|