Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Broad strategy question  RSS feed

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. If you have a minute, I have an approach question. I last developed J(2)EE apps around 2004. Those relied on JSP/applets/entitiy beans to interface with Oracle and stream files to and from an http server and launching on client machines.

I was looking at possible approaches today and was wondering using JSF, is it possible for a managedbean to stream to and form FTP site then use Desktop API to launch the file on client machine? To me, I'm thinking managedbean is server-side and not possible.

The I guess now scripting is the way (XMLHTTPRequest, JSON). Is that the approach to look at and use Tomcat or whatever as basically a container?

Thank you so much.
 
Saloon Keeper
Posts: 4877
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, managed beans live on the server. JSF is an MVC framework - it does its processing on the server, and then outputs text (like HTML) for display on the client.

I don't really understand the part about files and FTP, so I can't comment on that. And yes, if you want a web page to talk to the server. something built on top of XMLHTTPRequest (like the jQuery library) would be the way to go, with JSON being a useful data format.
 
author & internet detective
Marshal
Posts: 38687
677
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tommy,
With "old" EJBs, wouldn't you have just uploaded the file to a servlet and have the servlet FTP it?
 
Tommy Griffith
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:Tommy,
With "old" EJBs, wouldn't you have just uploaded the file to a servlet and have the servlet FTP it?



Thank you, Tim and Jeanne. I think I remember I couldn't access the local drive unless it was a downloaded applet, which then streamed i/o to a servlet which saved the stream to the server c:// drive (no FTP for that app at that time).

I guess I'm wondering if managed beans can access the local drive from a web app for streaming.
 
Sheriff
Posts: 23714
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your mention of applets suggests that "local drive" means "a drive on the client machine" as opposed to "a drive on the server". Both of those drives are of course "local" to something, so hopefully my guess is correct.

If so, then no, it's impossible for server code to access data on the client machine. You should be thankful for that, too. Imagine connecting to a server which could access files on your computer without your permission! (You may remember that applets came with a dialog which ensured you knew you were giving that permission to the applet.)
 
Tommy Griffith
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Paul. Yes, that's why I used applets back in 04-05. The applet serialized the local file then streamed to a servlet which dumped it into the server os. It also went in reverse, request to servlet which stremed file to local via (signed) applet. What would be the best approach to for user to select then stream or ftp binary from local to server (and vice--versa) in a JSP or JSF interface today?
 
Tommy Griffith
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I think web services might be best for this...
 
Tommy Griffith
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tommy Griffith wrote:Actually, I think web services might be best for this...



But still, i have the same issue, how could, after using a FileDialog, set up an stream on local file from JSP/JSF sans signed applet? I thought applets were history.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!