日期:2014-05-17 浏览次数:20766 次
import com.opensymphony.xwork2.ActionSupport;
public class test extends ActionSupport {
private String fffd;
public String test(){
fffd = "中文";
return "success";
}
public String getFffd() {
return fffd;
}
public void setFffd(String fffd) {
this.fffd = fffd;
}
}
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<s:property value="fffd"/>
</body>
</html>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.i18n.encoding" value="GBK" />
<package name="protal" namespace="" extends="struts-default">
<action name="test" class="test">
<result name="success">/index.jsp</result>
</action>
</package>
</struts>