• Post Reply Bookmark Topic Watch Topic
  • New Topic

Embed Swing Inside Servlet  RSS feed

 
Monoranjan Gorai
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a requirement to display folders & files in tree structure with drag & drop facility
in a web application. I am using Tomcat, JSP, Servlet. I tried to use AJAX for File Tree but.
It is very slow, since I have millions of files & folders. I have a sample of swing application
which gives File Tree feature with Drag & Drop. It is a stand alone application. I want to embed
this swing application inside my servlet, so that it can be accessible through the web.

Can anybody help me in this regard.

Thanks
Monoranjan
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only way to deliver Swing components to the client is to use applets or Java Web Start. Then, you would still have the same problem that you have showing the files using AJAX. You would, somehow, need to move that huge list of files and directories from the server down to the client over the internet.
 
Monoranjan Gorai
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben,
Thanks for your reply. Can you give me sample code please?
 
Sylven Yip
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think AJAX is the better solution.

1.if you use applet,the client must install jvm or java web start.the process is quite disgust.

2.beacuse of millions of files,applet can not imporve the speed either.the speed mainly depends on the speed of the internet.

3.javascript is not such a slow technology in your mind.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a sample of swing application
which gives File Tree feature with Drag & Drop. It is a stand alone application. I want to embed
this swing application inside my servlet, so that it can be accessible through the web.


The only reason the Swing app appears fast is that it can talk directly to the operating system. For a client-server application you will have to proceed in small steps, only transmitting the file information for a single directory tree at one time with a new request/response cycle every time a directory is opened or closed. On the server side you will have to track the user's "current" directory and also have a mechanmism for limiting access for security.

Bill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!