首页 > IT职业 > IT图书 > JAVA_Struts2学习小计
1、web.xml
2、struts2.xml
br/> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<!-- url-action-method(exacute())-result(view) -->
<!-- namespace URL的逻辑路径 -->
<!-- action中name可以支持通配符 如hello_* method='{1}'-->
<!-- 可以有多个result 根据action方法返回值与指定的name值匹配
返回相应视图 -->
<!-- Add your actions here -->
3、action类
package com.pluto.action;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport
{
private String uname;
@Override
public String execute() throws Exception
{
return "success_say";
}
public String getUname()
{
return uname;
}
public void setUname(String uname)
{
this.uname = uname;
} }
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/3324/viewspace-2799398/ ,如需转载,请注明出处,否则将追究法律责任。