【发布时间】:2016-03-29 07:43:46
【问题描述】:
我可能错了,但据我了解,WildFly 中必须有以下可能:
必须可以将链接放入我的 JSF 视图(即 xhtml 文件)中,指向已经在 WildFly 服务器上的资源(pdf、图像、其他 xhtml 文件)。
我可以在 php 和 apache 服务器中做同样的事情。
我需要将这些资源放在哪里?如何从我的视图中访问它们?例如。在视图中放置一个指向 pdf 文件的链接,该文件会在新选项卡中打开 pdf 文件。
非常感谢您的提示和提示!
编辑
独立的.xml
<server name="default-server">
<http-listener name="default" socket-binding="http" max-post-size="974247881"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<location name="/content" handler="ContentDir"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
<file name="ContentDir" path="${jboss.home.dir}/standalone/data/unzipped" directory-listing="true"/>
</handlers>
JSF 视图中的链接
<h:outputLink value="http://localhost:8181/content">KLICK</h:outputLink>
当我点击这个时,我得到了目录列表,正如你所说的。
但是如何才能让content指向的目录中的index.xhtml显示出来呢?这正是我想要的。
content 指向${jboss.home.dir}/standalone/data/unzipped,解压后有一个index.xhtml 以及另一个包含更多.xhtml 文件的文件夹。
在index.xhtml 中有指向文件夹中.xhmtl 文件的相对链接:
<ul>
<li><a href="t/rt.html">hg</a></li>
<li><a href="t/tert.html">jghj</a></li>
<li><a href="t/gf.html">jghj</a></li>
<li><a href="t/hg.html">jghj</a></li>
<li><a href="t/hgfh.html">jghj</a></li>
<li><a href="t/hfgh.html">jhgj</a></li>
<li><a href="t/hfgh.html">jhgj</a></li>
<li><a href="t/hg.html">jghj</a></li>
<li><a href="t/hghh.html">jghj</a></li>
</ul>
我想在unzipped 中显示index.xhtml 文件,然后从那里导航到其他.xhtml 文件。
这样的事情一定是可能的,不是吗??
或者你会如何编写一个应用程序,用户可以将 html 文件上传到 Java ee 服务器,然后查看这些文件的显示?
【问题讨论】:
标签: wildfly wildfly-8 undertow