myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m1380103 <m1380...@qub.ac.uk>
Subject Re: [Solved] GraphicImage Question
Date Fri, 23 Feb 2007 11:46:42 GMT

Thanks for the feedback.

The model for the application was created using EJBs previously with the
image variable used as a string in the database.  I planned to build the
front end without changing the model as a MVC proof.

Thanks
Michael.


Ken-6 wrote:
> 
> Michael,
> 
> Here's another option you can try that I've used successfully.  Store
> images
> in a database and create a PhaseListener to retrieve image and output the
> content.
> 
> Ken
> 
> 
> On 2/22/07, m1380103 <m1380103@qub.ac.uk> wrote:
>>
>>
>> Oh yeah of course.  Can't believe I got stuck on this problem without
>> thinking of it as being run through a remote browser.  I'll fix this by
>> making an image object reference in the code running on the server,
>> rather
>> than in the web page.
>>
>> Thanks, I'll try using my brain next time.
>> Michael.
>>
>>
>>
>> Veit Guna-2 wrote:
>> >
>> > Did I miss something? You're talking about an webapp right? That means,
>> > a user from location A calls your application at location B (A and B
>> are
>> > on different machines). So when the user uploads the image, it will be
>> > stored on B, right? So you (browser on A)can't access that file through
>> > an absolute (local) path! I think "value" takes an URL that the browser
>> > has to resolve. When this is C: it can't be reached on the server - it
>> > will try to find it on the local (A) machine. Just look into the source
>> > of your page, it will point to something like "C:...". It should be
>> > something like "http://youtserver/webapp/file" or "/webapp/file".
>> >
>> > But maybe I didn't get you right...
>> >
>> > regards,
>> > Veit
>> >
>> > m1380103 schrieb:
>> >> See that's why my problem came about.
>> >>
>> >> I wanted to save on the local folder thinking it would be simple to
>> use
>> >> graphicimage with either c:\\images\\uniqueId or c:\images or
>> c:/images
>> >> but
>> >> I haven't found any way to work yet.  I think it might be helped if I
>> >> pass
>> >> the image directory location from the java class.  The strange thing I
>> >> noticed from the page source after JSF had rendered was that the
>> windows
>> >> \
>> >> was not shown in the source.  That's why I thought it might be related
>> to
>> >> the graphicImage tag's use of the \ symbol, even when \\ was used.
>> >>
>> >> I can't seem to find an example anywhere online where the tag is used
>> to
>> >> read from outside the deployment directory, maybe the original idea
>> for
>> >> writing a renderer so the directory for the images can be set is the
>> only
>> >> way to go about this.
>> >>
>> >>
>> >> MichaƂ  wrote:
>> >>> Perhaps:
>> >>>
>> >>> <graphicImage value="C:\\images\\uniqueId">
>> >>>
>> >>> ?
>> >>>
>> >>> michael
>> >>>
>> >>> On 22/02/07, m1380103 <m1380103@qub.ac.uk> wrote:
>> >>>> Thanks for the quick reply,
>> >>>>
>> >>>> I have spent some time looking over the JSF examples, including
the
>> >>>> sandboxes graphicDynamicImage.  My problem really lies in displaying
>> an
>> >>>> image from outside the deployment directory.  There is no dynamic
>> >>>> action
>> >>>> needed in my application so I thought the standard graphicImage
>> would
>> >>>> do,
>> >>>> just not sure why my <graphicImage value="C:\images\uniqueId">
>> wouldn't
>> >>>> work.
>> >>>>
>> >>>> I will look into extending the imagerenderer to read images from
a
>> >>>> directory
>> >>>> on the hard drive, though if anyone knows a simple example of using
>> the
>> >>>> graphicImage and reading from a standard windows folder, the help
>> would
>> >>>> be
>> >>>> much appreciated.
>> >>>>
>> >>>> Thanks
>> >>>> Michael.
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> Veit Guna-2 wrote:
>> >>>>> Hi.
>> >>>>>
>> >>>>> Take a look at the sandbox graphicDynamicImage. There you can
write
>> >>>> your
>> >>>>> own ImageRenderer and you're free where you read the images
from.
>> >>>>>
>> >>>>> In my webapp uploaded files go to a separate directory outside
the
>> >>>>> deployment directory of tomcat. The ImageRenderer reads files
from
>> >>>> there
>> >>>>> and displays them to the user.
>> >>>>>
>> >>>>> Perhaps it helps.
>> >>>>>
>> >>>>> regards,
>> >>>>> Veit
>> >>>>>
>> >>>>>
>> >>>>> m1380103 schrieb:
>> >>>>>> Basically I'm building an ecommerce site using MyFaces.
 I have
>> over
>> >>>>>> a
>> >>>>>> years
>> >>>>>> experience with it, though I've come across a problem I
have never
>> >>>>>> encountered before.
>> >>>>>>
>> >>>>>> For this site the user can upload images of the item they
are
>> >>>>>> selling.
>> >>>>>> Except I am having some problems with storing this and displaying
>> the
>> >>>>>> info
>> >>>>>> on screen.  I was going to save the image to a location
locally
>> >>>>>> ("C:\images\uniqueId") and display this with <h:graphicImage>
but
>> it
>> >>>> does
>> >>>>>> seem to like reading from this location.  I am running on
a
>> windows
>> >>>>>> machine
>> >>>>>> but noticed when supplying the string for the location of
an icon
>> >>>> saved
>> >>>>>> within the application the directory would be /Deploy Name/image.
>> >>>>>>
>> >>>>>> How can I use the graphicImage tag to read from outside
it's JBoss
>> >>>>>> deployment?  Or would it be better saving somewhere else
when a
>> user
>> >>>>>> uploads
>> >>>>>> an image?
>> >>>>>>
>> >>>>>> Any help would be much appreciated as I have no experience
with
>> >>>> uploading
>> >>>>>> and saving of images on this form of web application.  I
would
>> prefer
>> >>>> to
>> >>>>>> save a link in the database and display this way if possible.
>> >>>>>>
>> >>>>>> Thanks
>> >>>>>> Michael.
>> >>>>>
>> >>>> --
>> >>>> View this message in context:
>> >>>> http://www.nabble.com/GraphicImage-Question-tf3273198.html#a9101992
>> >>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>> >>>>
>> >>>>
>> >>>
>> >>> --
>> >>> stawicki@gmail.com
>> >>> http://stawicki.jasliska.pl
>> >>> GG: 3691111
>> >>> JID: stawicki@gmail.com
>> >>>
>> >>>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/GraphicImage-Question-tf3273198.html#a9103742
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 303-619-6607
> http://adsea.com
> 
> 

-- 
View this message in context: http://www.nabble.com/GraphicImage-Question-tf3273198.html#a9117440
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message