I've done it like this:

----------------------------------------------------------------------------------------
<h:outputLink
   value="#{bean.imageURL}">Image</h:outputLink>
----------------------------------------------------------------------------------------
        <managed-bean>
            <managed-bean-name>imageFileLocator</managed-bean-name>
[...]
            <managed-property>
                <property-name>clientUrlPrefix</property-name>
                <value>file:\\X:\dir\dir\dir\dir\</value>
            </managed-property>
----------------------------------------------------------------------------------------
        protected String urlIfFileExists(String fileName)
        {
                File file = new File(getServerDirectory(), fileName);
                if (file.exists())
                {
                        return getClientUrlPrefix() + fileName;
                }
                
                return null;
        }
----------------------------------------------------------------------------------------

On 4/25/07, Volker Weber <[EMAIL PROTECTED]> wrote:
Hi,

'file:///F:/dev/dir.pdf' is OK on linux systems (if /F:/dev/dir.pdf exists),
i don't know how to make this work on windows,
you can try "file:/F:\dev\dir.pdf" maybe there is just one '/' to much
after 'file:'

Regards,
    Volker



2007/4/25, Brummeline Braathen <[EMAIL PROTECTED]>:
> Volker Weber <v.weber <at> inexso.de> writes:
>
> >
> > Hi,
> >
> > try "file://F:\dev\dir.pdf"
> >
> > are you sure the error is "... c is not connected ..."?
> > should be "... F is not connected ..." in this case.
>
> Ops, it was F is not connected, a little writing error:)
>
> I tried your suggestion, but then nothing happends. Whe I hold the cursor over
> the link it says: file:///F:/dev/dir.pdf
>
>
>
>

Reply via email to