社区
非技术版
帖子详情
struts第一个hello world项目
weixin_44856906
2019-05-02 01:02:56
第一步:新建web project,勾选web.xml 第二步:项目右键,Configure Facts ,install apach struts(2.x)Facts,然后会自动生成 struts.xml文件 里面自动生成内容,web.xml中会自动生成内容 <filter> <filter-name>struts2 </filter-name> <filter-class>org.apache.struts2.dispather.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> ,并且会自动生成需要的包文件Struts2.1Library。 第三步:此时,在src下面新建一个包,取名com.action,包下面新建一个类HelloAction.java,在类中新建创建一个方法 public String execute(){ System.out.println("execute方法执行了!"); return "success"; } 第四步:在struts.xml中配置action 第五步:index.jsp <form action="Hello.Action.action" method="post"> <input type="submit" value="点一下玩一年"> </form> hello.jsp <p>点一下怎么可能玩一年</p> 可能会需要重新打开软件再开启服务器后 完成之后在浏览器输入路径localhost:8080/项目名/
...全文
47
回复
打赏
收藏
struts第一个hello world项目
第一步:新建web project,勾选web.xml 第二步:项目右键,Configure Facts ,install apach struts(2.x)Facts,然后会自动生成 struts.xml文件 里面自动生成内容,web.xml中会自动生成内容 struts2 org.apache.struts2.dispather.ng.filter.StrutsPrepareAndExecu
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Struts
2的
第一个
实例
hello
world
Struts
2的入门小实例
hello
world
,jar包齐全,可以运行。
Struts
2 实例
Hello
World
本章完成一个
Hello
World
实例开发的演示,目的是使读者可以对
struts
2有一个整体的认识,熟悉glassfish2的使用,主要讲解了一个简单的
Struts
2应用的
Hello
World
实例,这个例子可以帮助读者快速入门,获得开发
Struts
2...
第二章
Struts
2 下的
Hello
World
源码 1
Struts
2 下的
Hello
World
源码 1
struts
框架-
hello
world
第一个
struts
框架的完成,使用eclipse写的。第一次写其实是在半年前,现在再重新写,真是错误连篇,最讨厌的是报404错误。首先检查tomcat部署时,有什么错误,针对性解决,大多是因为jar包多了或者少了。有时,jar包...
struts
项目
搭建
二、
第一个
Struts
2.0应用程序——
Hello
World
下面我们进行臭名昭著的
Hello
World
程序。几乎所有语言的
第一个
程序都是
Hello
World
。在src目录上右键,新建一个类,参数如下: 类的内容如下: package ...
非技术版
11,849
社区成员
33,690
社区内容
发帖
与我相关
我的任务
非技术版
MS-SQL Server 非技术版
复制链接
扫一扫
分享
社区描述
MS-SQL Server 非技术版
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章