无法在我的系统中配置 Struts

发布于 2024-11-29 12:38:40 字数 154 浏览 9 评论 0原文

我已经安装了Eclipse Heloios3.6和Tomcat 6.0和jdk 1.6。

你能给出struts的库文件和struts的配置文件,即struts-config.xml和web.xml吗?

当我尝试运行 struts 时,它显示请求的资源不可用错误。

I have installed Eclipse Heloios3.6 and Tomcat 6.0 and jdk 1.6.

Can you give the library files for struts and configuration file for struts namely struts-config.xml and web.xml?

While I tried to run struts, it shows the requested resource is not available error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

咆哮 2024-12-06 12:38:40

假设您指的是 Struts 2,您是否查看过这里: http://struts .apache.org/2.x/docs/home.html

web.xml 的核心部分是这样的:

<filter>
 <filter-name>struts2</filter-name>
 <filter-class>
  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
 </filter-class>

 <init-param>
  <param-name></param-name>
  <param-value></param-value>
 </init-param>
</filter>

<filter-mapping>
 <filter-name>struts2</filter-name>
 <url-pattern>/*</url-pattern>
 <dispatcher>REQUEST</dispatcher>
 <dispatcher>FORWARD</dispatcher>
</filter-mapping>

然后,类路径中有一个 struts.xml,而不是 struts-config.xml(尽管您可能能够配置查找)。

Assuming you mean Struts 2, did you have a look here: http://struts.apache.org/2.x/docs/home.html?

The core part of web.xml is this:

<filter>
 <filter-name>struts2</filter-name>
 <filter-class>
  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
 </filter-class>

 <init-param>
  <param-name></param-name>
  <param-value></param-value>
 </init-param>
</filter>

<filter-mapping>
 <filter-name>struts2</filter-name>
 <url-pattern>/*</url-pattern>
 <dispatcher>REQUEST</dispatcher>
 <dispatcher>FORWARD</dispatcher>
</filter-mapping>

Then there's a struts.xml in your classpath, not a struts-config.xml (although you might be able to configure the lookup).

装纯掩盖桑 2024-12-06 12:38:40

从官方下载页面下载示例应用程序并在您的 tomcat 中运行

它不仅会给您一个运行示例,还会帮助您了解他们如何打包应用程序、哪些资源在哪些位置、所需的依赖项是什么以及什么运行应用程序所需的其他配置

Struts2 示例应用程序下载

从此处下载示例应用程序你会的获取 struts2-blank-xxx war 文件,这是一个标准的 struts2 结构,正在运行 hello world 应用程序

download sample applications from there official download page and run in your 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

Download sample applications from here and you will get struts2-blank-x.x.x war file which is a standard struts2 structure with running hello world application

じее 2024-12-06 12:38:40

您需要的 jar 文件,首先是:

  • commons-logging-1.0.4.jar
  • freemarker-2.3.8.jar
  • ognl-2.6.11.jar
  • struts2-core-2.0.12。 jar
  • xwork-2.0.6.jar

你的 struts.xml 将具有以下结构:

<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
    <constant name="struts.custom.i18n.resources" value="ApplicationResources" />

    <package name="project"  extends="struts-default">
            <action name="Download" class="project.action.DownloadAction">
            <result name="success">/jsp/common/downloadPage.jsp</result>
        </action>     
    </package>

    <include file = "Admin-Config.xml"/>
</struts>

The jar files you need, to start with:

  • commons-logging-1.0.4.jar
  • freemarker-2.3.8.jar
  • ognl-2.6.11.jar
  • struts2-core-2.0.12.jar
  • xwork-2.0.6.jar

Your struts.xml will have this struture:

<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
    <constant name="struts.custom.i18n.resources" value="ApplicationResources" />

    <package name="project"  extends="struts-default">
            <action name="Download" class="project.action.DownloadAction">
            <result name="success">/jsp/common/downloadPage.jsp</result>
        </action>     
    </package>

    <include file = "Admin-Config.xml"/>
</struts>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文