You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Grigorov <ma...@gmail.com> on 2016/10/06 02:40:37 UTC

Re: hyperlink to a file on the server but ouside of the wicket war ?

Hi,

See ResourceLink component.

On Oct 5, 2016 6:18 PM, "andre seame" <an...@hotmail.fr> wrote:

> Hello,
>
>
> I have a windows server with TOMCAT and a wicket application in
> d:\apache-tomcat\webapps\mywcketapplication.war
>
>
> On this server, I have a shared disk where someone has put
> \\myserver\TestResults\image_timestamp.png.
>
>
> The wicket application can access to the file throught :
> d:/TestRsults/image_timestamp.png
>
>
> I would like to add in a wicket page a hyperlink to image_timestamp.png.
> My first (very stupid) idea was to set <a href="d:/TestRsults/image_timestamp.png"
> ...
>
>
> Questions are :
>
>   *   What is the hyperlink ?
>   *   Must I configure tomcat to access to d:\result ?
>   *   Must I configure the wicket application to access to the file ?
>
>
> Thanks,
>
> PHL.
>

Re: hyperlink to a file on the server but ouside of the wicket war ? (solved)

Posted by Tobias Soloschenko <to...@googlemail.com>.
Hi,

or you can use FileSystemResource / FileSystemResourceReference (Wicket 7)

kind regards

Tobias

> Am 07.10.2016 um 09:16 schrieb andre seame <an...@hotmail.fr>:
> 
> Thanks,
> 
> 
> Other solution.
> 
> 
> In the wiceket code : for a file in \\myserver\TestResults\A\B\image_timestamp.png. transform it in http://mysserver:8080/testresults/A/B/image_timestamp.png<https://outlook.live.com/owa/%5C%5Cmyserver%5CTestResults%5CA%5CB%5Cimage_timestamp.png.>
> 
> 
> Add this hyperling in your Wicket page.
> 
> 
> see http://stackoverflow.com/questions/9434964/tomcat-mapping-context-via-server-xml or http://stackoverflow.com/questions/1812244/simplest-way-to-serve-static-data-from-outside-the-application-server-in-a-java). The idea is to use tomcat as a file server.
> 
> 
> So in my apache-tomcat/conf/localhost forlder (I create the localhost folder), I add a file : Access_to_testresults.xml
> 
> 
> <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
>    <Context deployOnStartup="true" docBase="C:\TestResults<https://outlook.live.com/owa/%5C%5Cmyserver%5CTestResults%5CA%5CB%5Cimage_timestamp.png.>\" path="/testresults" reloadable="false">
>    <Manager pathname=""/>
> </Context>
> 
> 
> Then I can access to all hyperlinks and read image, text, ... without any Java code.
> 
> 
> 
> Thanks.
> 
> 
> 
> ________________________________
> De : Martin Grigorov <ma...@gmail.com>
> Envoyé : jeudi 6 octobre 2016 02:40
> À : users@wicket.apache.org
> Objet : Re: hyperlink to a file on the server but ouside of the wicket war ?
> 
> Hi,
> 
> See ResourceLink component.
> 
>> On Oct 5, 2016 6:18 PM, "andre seame" <an...@hotmail.fr> wrote:
>> 
>> Hello,
>> 
>> 
>> I have a windows server with TOMCAT and a wicket application in
>> d:\apache-tomcat\webapps\mywcketapplication.war
>> 
>> 
>> On this server, I have a shared disk where someone has put
>> \\myserver\TestResults\image_timestamp.png<file://\\myserver\TestResults\image_timestamp.png>.
>> 
>> 
>> The wicket application can access to the file throught :
>> d:/TestRsults/image_timestamp.png
>> 
>> 
>> I would like to add in a wicket page a hyperlink to image_timestamp.png.
>> My first (very stupid) idea was to set <a href="d:/TestRsults/image_timestamp.png"
>> ...
>> 
>> 
>> Questions are :
>> 
>>  *   What is the hyperlink ?
>>  *   Must I configure tomcat to access to d:\result ?
>>  *   Must I configure the wicket application to access to the file ?
>> 
>> 
>> Thanks,
>> 
>> PHL.
>> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: hyperlink to a file on the server but ouside of the wicket war ? (solved)

Posted by andre seame <an...@hotmail.fr>.
Thanks,


Other solution.


In the wiceket code : for a file in \\myserver\TestResults\A\B\image_timestamp.png. transform it in http://mysserver:8080/testresults/A/B/image_timestamp.png<https://outlook.live.com/owa/%5C%5Cmyserver%5CTestResults%5CA%5CB%5Cimage_timestamp.png.>


Add this hyperling in your Wicket page.


see http://stackoverflow.com/questions/9434964/tomcat-mapping-context-via-server-xml or http://stackoverflow.com/questions/1812244/simplest-way-to-serve-static-data-from-outside-the-application-server-in-a-java). The idea is to use tomcat as a file server.


So in my apache-tomcat/conf/localhost forlder (I create the localhost folder), I add a file : Access_to_testresults.xml


<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
    <Context deployOnStartup="true" docBase="C:\TestResults<https://outlook.live.com/owa/%5C%5Cmyserver%5CTestResults%5CA%5CB%5Cimage_timestamp.png.>\" path="/testresults" reloadable="false">
    <Manager pathname=""/>
</Context>


Then I can access to all hyperlinks and read image, text, ... without any Java code.



Thanks.



________________________________
De : Martin Grigorov <ma...@gmail.com>
Envoyé : jeudi 6 octobre 2016 02:40
À : users@wicket.apache.org
Objet : Re: hyperlink to a file on the server but ouside of the wicket war ?

Hi,

See ResourceLink component.

On Oct 5, 2016 6:18 PM, "andre seame" <an...@hotmail.fr> wrote:

> Hello,
>
>
> I have a windows server with TOMCAT and a wicket application in
> d:\apache-tomcat\webapps\mywcketapplication.war
>
>
> On this server, I have a shared disk where someone has put
> \\myserver\TestResults\image_timestamp.png<file://\\myserver\TestResults\image_timestamp.png>.
>
>
> The wicket application can access to the file throught :
> d:/TestRsults/image_timestamp.png
>
>
> I would like to add in a wicket page a hyperlink to image_timestamp.png.
> My first (very stupid) idea was to set <a href="d:/TestRsults/image_timestamp.png"
> ...
>
>
> Questions are :
>
>   *   What is the hyperlink ?
>   *   Must I configure tomcat to access to d:\result ?
>   *   Must I configure the wicket application to access to the file ?
>
>
> Thanks,
>
> PHL.
>