Eric Pascarello wrote:
and have that jsp/servlet return the image.
Eric
Lance Walker wrote:I wasn't aware I would need to sign my applet to access something on a local server
Bear Bibeault wrote:
Lance Walker wrote:I wasn't aware I would need to sign my applet to access something on a local server
"local server" is an oxymoron. What do you mean by that?
Bear Bibeault wrote:If there's no reloading, what's wrong with Eric's simple solution? You seem hell-bent on complicating this unnecessarily with an applet.
You do realize that applets run on the client, right?
Paul Clapham wrote:I can tell you right now that your applet is going to look on the client for those files (that's what a File object means) and not on the server. And if you test it by running it via a browser on the same machine where the server is running, you're going to hide that error until you try deploying it.
You're going to need something on the server which returns a list of image files from a directory, since nothing has direct access to a directory on the server over the web. Not Javascript, not applets either.
By the way your home-grown URL-encoding method (changing space to %20) should be replaced to a call to a standard URL encoding routine. Both Javascript and Java have one.
Bear Bibeault wrote:No, this can actually be quite simple. It's the applet red herring that made this seem complicated.
If this is hosted as a Java web app it would be rather trivial to do in a JSP.
Otherwise, an Ajax solution, made easy with jQuery, might be the best bet. With it, you could send back to the server on page load for a list of n image names returned in JSON format that you would then use to create the image elements on the fly.
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|