简体   繁体   English

带有 eclipse 的 struts 2 简单的 helloworld 示例

[英]struts 2 simple helloworld example with eclipse

I tried lot of exmaples in net.我在网上尝试了很多例子。 But still i'm unable to run a simple helloworld program using struts 2. Whenever i'm trying i'm getting the "resource not found error" evn though if i followed the steps correctly as per the example in the net.但是我仍然无法使用 struts 2 运行一个简单的 helloworld 程序。每当我尝试时,我都会收到“找不到资源错误”,即使我按照网络中的示例正确执行了这些步骤。 If any one can give me a step by step procedure surly it will a great help for me!如果有人可以给我一步一步的程序,那将对我有很大的帮助!

If you are familiar with Maven 2 then you can use Struts2 architype-basic it will create and setup a hello world struts2 application.如果您熟悉 Maven 2 那么您可以使用 Struts2 架构基础,它将创建和设置一个 hello world struts2 应用程序。 this will work. 会奏效。

I have posted several times for this problem, best way to start learning any framework is to try there hands around the example applications being distrusted along with the framework.我已经针对这个问题发布了好几次,开始学习任何框架的最佳方法是尝试与框架一起不信任的示例应用程序。

Struts2 is not an exception in this.Just download sample applications from there official download page and run in your tomcat Struts2 也不例外。只需从官方下载页面下载示例应用程序并在您的 tomcat 中运行

It will not only give you a running example but also will help you to understand how they have packed there application what resources is going at what places,what are the required dependencies and what other configurations one need to run an application它不仅会给你一个运行的例子,还会帮助你理解他们是如何打包应用程序的

Struts2 Sample Application Download Struts2 示例应用下载

Download sample applications from here and you will get struts2-blank-xxx war file which is a standard struts2 structure with running hello world application从这里下载示例应用程序,您将获得 struts2-blank-xxx war 文件,它是一个标准的 struts2 结构,运行 hello world 应用程序

Regarding maven its a best way to create a standard application structure to start with but if you are not familiar with maven than my best suggestion is to put time to learn Struts2 at the moment and maven can be captured along the way Regarding maven its a best way to create a standard application structure to start with but if you are not familiar with maven than my best suggestion is to put time to learn Struts2 at the moment and maven can be captured along the way

This might be taken as a terrible travesty to some but...这可能对某些人来说是一种可怕的讽刺,但是......

I wrote out this perfectly good and quite detailed description to take someone by the hand and walk though though doing just this with netbeans, found here: Struts2 & NetBeans 7我写了这个非常好的和非常详细的描述,虽然只是用 netbeans 做这个,但在这里找到: Struts2 & NetBeans 7

Download the Java EE version of netbeans: http://netbeans.org/downloads/ follow my tutorial.下载Java EE版netbeans: http://netbeans.org/downloads/按照我的教程。

Now to defend why this isn't a travesty, both IDE's being what they are (which is great btw), you should now be able to go back to Eclipse and get struts2 going.现在来捍卫为什么这不是讽刺,两个IDE都是它们的样子(顺便说一句),你现在应该能够将go回到Eclipse并得到ZE208E5ACAD4608B373C7475A。 That is to say the issue isn't the IDE, but the lack of a really gentle walk though for your particular IDE.也就是说,问题不在于 IDE,而是您的特定 IDE 缺乏真正温和的行走。 In getting this working it would be great if you would detail all the steps as well as I did for netbeans, post a solution to this question and I would definitely upvote both your question and answer and I would point Eclipse users here!在完成这项工作时,如果您能像我为 netbeans 所做的那样详细说明所有步骤,那就太好了,发布这个问题的解决方案,我肯定会赞成您的问题和答案,我会在这里指出 Eclipse 用户!

PS: There is nothing wrong with using the demo application but a very specific walk though is better as new users to web programming with java EE generally have no idea what they are looking at. PS:使用演示应用程序没有任何问题,但是非常具体的步行虽然更好,因为使用 java EE 进行 web 编程的新用户通常不知道他们在看什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM