jboss 6 虚拟目录
我无法找到将目录添加到 jboss 6 上的应用程序上下文的正确方法。 我将将此映射用于静态内容。有人可以帮我吗?
I cannot find a proper way to add a directory to my app context on jboss 6.
I'll use this mapping for static content. Can someone give me a hand on that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
JBoss 6 中不再有“虚拟目录”。显然,这在 JBoss 5 中就消失了。我发现的唯一可用选项是:
There are no more 'virtual directories' in JBoss 6. Apparently this went out with JBoss 5. The only available options I've found are:
坏消息是您只能在 JBoss 应用程序内提供静态内容。好消息是,将任何文件夹转换为应用程序文件夹都很容易。
最简单的解决方案是将所有静态内容复制到
server\default\deploy\ROOT.war
目录中。更复杂的解决方案如下。
将
ROOT.war
文件夹复制到您想要放置的位置静态内容。
将
ROOT.war
重命名为您喜欢的任何名称,但必须以.war
结尾,例如
my_static_content.war
。将所有静态内容放入该目录。
启用外部部署到包含静态文件的文件夹
内容文件夹。使用 JBoss 6 和 JBoss 5
重新启动 JBoss
您的内容将进入 URI
http:\\localhost: 8080\my_static_content\
。您必须指定要提供的文件的确切名称,因为不允许列出目录。The bad news is that you can serve static content only inside JBoss applications. The good news is that it is very easy to transform any folder into an application folder.
The easiest solution is to copy all your static content into your
server\default\deploy\ROOT.war
directory.A more complex solution is the following.
Copy the
ROOT.war
folder in the position where you want to put yourstatic content.
Rename
ROOT.war
into any name you like but it must end with.war
,for instance
my_static_content.war
.Put all your static content into that directory.
Enable external deploy to the folder that contains your static
content folder. External deploy with JBoss 6 and JBoss 5
Restart JBoss
Your content will be into the URI
http:\\localhost:8080\my_static_content\
. You have to specify the exact name of the files that you want to serve, because directory listing is not allowed.此线程帮助我在外部目录中获取静态内容在 jboss eap 5.1 上提供,无需使用链接,也无需移动或重命名 ROOT.war 文件夹。
请注意,您仍然需要创建一个目录结构来诱骗 jboss 提供您的内容。这并不像添加那么容易。的子元素在 server.xml 文件中。这看起来像是一个黑客,但至少它有效。
this thread helped me get static content in an external directory served up on jboss eap 5.1 without the use of links and without moving or renaming the ROOT.war folder.
note that you still have to create a directory structure that tricks jboss into serving up your content. it's not as easy as adding a <Context> child element to the <Host name="localhost"> in the server.xml file. it seems like a hack but at least it works.