---
title: "利用Stripes写的一个简单Action"
author: "javapub"
date: "2013-02-19T09:54:46Z"
tags: ["Java", "Stripes", "action", "例子"]
categories: ["编程语言"]
slug: "stripes-action"
draft: false
lastmod: "2013-02-18T15:24:12Z"
id: 1807360
url: "https://javapub.iteye.com/blog/1807360"
---

```java
public class HelloActionBean implements ActionBean {
	ActionBeanContext context;

	public void setContext(ActionBeanContext context) {
		this.context = context;
	}

	public ActionBeanContext getContext() {
		return this.context;
	}

	String message;

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	@HandlesEvent("sayHello")
	public Resolution greeting() {
		// return new RedirectResolution("/greeting.jsp");
		return new ForwardResolution("/jsp/greeting.jsp");
	}
}
```