簡體   English   中英

GlassFish 4 Alternativedoc不起作用

[英]GlassFish 4 alternatedoc doesn't work

我正在嘗試使用alternativedoc訪問外部文件夾,但是它不起作用。 我將圖像放在C:/users/salih/downloads並將images文件夾映射到此文件夾,但是我無法使其工作。

這是glassfish-web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
  <resource-ref>
    <res-ref-name>jdbc/mysql</res-ref-name>
    <jndi-name>jdbc/mysql</jndi-name>
  </resource-ref> 
   <context-root>/Shiro</context-root>
      <property name="alternatedocroot_1" value="from=/images/* dir=c:/users/salih/downloads" description="Uploaded Images"/>
</glassfish-web-app>

這是我嘗試在c:/users/salih/downloads下訪問圖像的頁面

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        Photo Detail
        <img src="images/adevices8.png" width="34" height="34"/>
    </h:body>
</html>

映射可能有點不直觀。 您需要將圖像放入

c:/users/salih/downloads/images/

如果你這樣定義你的docroot

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM