日期:2014-05-18 浏览次数:20680 次
<?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>
<package name="zxw_02" namespace="/zxw_nsp_02" extends="struts-default">
<action name="zxw_action_01" class="com.action.HelloWorld" method="execute">
<result name="success">/page/hello.jsp</result>
</action>
</package>
</struts>
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head></head>
<body>
This is my JSP page.${message2 }.${message }<br>
</body>
</html>
package com.action;
public class HelloWorld {
private String message;
private String message2;
public String execute(){
message = "+ gsgs +";
message2 = "Congratulation!";
return "success";
}
public void setMessage2(String msg){
this.message2 = msg;
}
public String getMessage2(){
return this.message2;
}
}