Java Open Source

Java4cy
posts(5) comments(2) trackbacks(0)
  • BlogJava
  • 联系
  • RSS 2.0 Feed 聚合
  • 管理

常用链接

  • 我的随笔
  • 我的评论
  • 我的参与
  • 最新评论

留言簿

  • 给我留言
  • 查看公开留言
  • 查看私人留言

随笔档案

  • 2007年8月 (5)

搜索

  •  

最新评论

  • 1. re: [导入]Hello World
  • 都是转载啊。
  • --dreamstone
  • 2. re: [导入]Java入门需掌握的30个基本概念
  • 不错。
  • --姜利阳

阅读排行榜

评论排行榜

View Post

[导入]Hello World

jsp file
 
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h2><s:property value="message" /></h2>
</body>
</html>
actions
package tutorial;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport {
public static final String MESSAGE = "Struts is up and running ...";
public String execute() throws Exception {
setMessage(MESSAGE);
return SUCCESS;
}
private String message;
public void setMessage(String message){
this.message = message;
}
public String getMessage() {
return message;
}
}
 xml mapping files
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="tutorial" extends="struts-default">
<action name="HelloWorld" class="tutorial.HelloWorld">
<result>/HelloWorld.jsp</result>
</action>
<!-- Add your actions here -->
</package>
</struts>

文章来源:http://java4cy.blog.163.com/blog/static/43270124200772591435179

posted on 2007-08-27 17:40 Randy 阅读(317) 评论(1)  编辑  收藏

View Comments

# re: [导入]Hello World  回复  更多评论   
都是转载啊。
2007-08-29 17:45 | dreamstone
新用户注册  刷新评论列表  

只有注册用户登录后才能发表评论。


网站导航:
博客园   IT新闻   Chat2DB   C++博客   博问   管理
 
 
Powered by:
BlogJava
Copyright © Randy