2017-06-06 3 views
0

WebApplicationがあり、クライアント側のマウントされたネットワークドライブに直接アクセスする必要があります(はドライブZ:\にマッピングされています)。JSF/Primefacesファイルシステムへのリンク

私は、次の試してみましたが、何もうまくいかない:

<a target="_blank" href="file:///server/zentrale/username/data">user files</a> 
<h:outputlink target="_blank" value="file:///server/zentrale/username/data">user files</a> 

<a target="_blank" href="file:///Z:/username/data">user files</a> 
<h:outputlink target="_blank" value="file:///Z:/username/data">user files</a> 

私もjboss-web.xml<disable-cross-context>false</disable-cross-context>を追加 - 成功せず。

@BalusC JSF 2 and a link to file systemに記載されています。新しいWebアプリケーションコンテキストを作成します。 WildFly 10とPrimefaces 6.1を使ってどうすればいいですか?

WebApplicationの古いバージョンでは、Firefox用にIE Viewプラグインを使用しましたが、これは2013年に最後に更新されました! ChromeやIEのような他のブラウザをサポートする必要があるため、一部のブラウザプラグインに依存したくないです!

+1

これはまともなブラウザでは**決して**動作しません...プレーンhtmlのセキュリティの問題...(プレーンhtmlファイルで試しても動作しません)。これはすべてあなたが参照するリンクに記載されています。 – Kukeltje

答えて

0

https://developer.jboss.org/thread/227893私は、サーバ側のローカルファイルシステムへのアクセス方法を知っています。

standalone.xml

<subsystem xmlns="urn:jboss:domain:undertow:3.0"> 
    <buffer-cache name="default"/> 
    <server name="default-server"> 
     <http-listener name="default" socket-binding="http" redirect-socket="https"/> 
      <host name="default-host" alias="localhost"> 
       <location name="/" handler="welcome-content"/> 
       <location name="documents" handler="document-handler"/> 
       <filter-ref name="server-header"/> 
       <filter-ref name="x-powered-by-header"/> 
      </host> 
    </server> 
    <handlers> 
     <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/> 
     <file name="document-handler" directory-listing="true" path="\\server\Zentrale\docments"/> 
    </handlers> 
</subsystem> 

が、これは次のコマンドを使用しjboss-cli.shを使用して達成するために:

/subsystem=undertow/server=default-server/host=default-host/location=documents:add(handler=document-handler) 
/subsystem=undertow/configuration=handler/file=document-handler:add(path=\\\\server\\Zentrale\\documents, directory-listing=true) 

page.xhtmlの各リンクをクリックしたが、私は移動することができ、ブラウザで新しいタブを開きますサーバーのファイルシステム - 共有フォルダでも!

page.xhtml

<a href="/documents/projects/project_4711/" target="_blank">Project 4711</a> 
<h:outputLink value="/documents/projects/project_4711/" target="_blank">Project 4711</h:outputLink> 

これは私の問題の解決策ですが、はい - それは私がクライアントのローカルファイルシステムに移動することはできません!

+0

これにサーブレットを使う方がいいです(アプリケーションサーバーに依存しません) – Kukeltje

+0

サーブレットでこれを行う方法はありますか? – raho

+1

はい、stackoverflowとgoogleを検索してください。多くの例 – Kukeltje

関連する問題