<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<!-- Overwrite Convention -->
test
success.jsp
test
package com.svgteam.action;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class MyAction extends ActionSupport{
/**
*
*/
private static final long serialVersionUID = 1L;
HttpServletRequest req = ServletActionContext.getRequest();
String name = req.getParameter("username");
String pwd = req.getParameter("pwd");
public String index(){
if(name.equals("admin")&&pwd.equals("1111"))
return "success";
else
return "failed";
}
}