struts (三)

时间:2023-03-09 03:39:28
struts (三)

1、

<action name="test" class="com.gc.Test">

<result name="success">

/hello.jsp

</result

</action>.

2、

action实现得方式

a.普通java类

class Test {

public String execute() {

return "success"

}

}

b.实现action接口

class Test impliments Action {

//重写execute方法

pbulic String execute() {

return success

}

c.继承ActionSupport

class Test extends ActionSupport

{

//重写execute方法

}

}