在哪里放置struts.xml [英] Where to put struts.xml

查看:138
本文介绍了在哪里放置struts.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Struts2,我们必须在类路径中具有 struts.xml ,因此在WEB-INF下使其不再起作用。因此,我部署项目的方式是将其保留在 WEB-INF / classes 下,并包含 ../ struts2.xml

With Struts2 we have to have struts.xml in the class path, so it no longer works to have it under WEB-INF. So the way I got my project to deploy was to stick it under WEB-INF/classes and have it include ../struts2.xml

2问题:


  1. Eclipse清除类文件夹,当我进行重建时,因此
    删除 struts.xml

  2. Eclipse在以下位置不显示classes文件夹我的项目浏览器,因此
    是一个很糟糕的地方,它一开始就将配置文件保留在其中。

Struts2 Eclipse如何开发人员正在执行此操作?

How are you Struts2 Eclipse developers doing this?

推荐答案

您可以将struts.xml放在源目录的根目录下,也可以设置其他目录资源源目录并将其放在那里。 Eclipse编译时很高兴为您将其复制到WEB-INF / classs。

You can either just put the struts.xml at the root of your source directory or set up an additional resources source directory and put it there. Eclipse quite happily copies it to WEB-INF/classes for you when it does a compilation.

这篇关于在哪里放置struts.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆