aspose file tools*
The moose likes Servlets and the fly likes servlets with swings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlets with swings" Watch "servlets with swings" New topic
Author

servlets with swings

trinadh reddy
Ranch Hand

Joined: Sep 22, 2005
Posts: 60
can we write swing applications in servlets
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
Yes, it's possible. Do not forget to use option headless if servlet runs on Unix boxes.


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
trinadh reddy
Ranch Hand

Joined: Sep 22, 2005
Posts: 60
where can i find sample code to include swing applications in servlets
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by trinadh reddy:
can we write swing applications in servlets


I would say, No.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Why do you want a GUI component that runs on the server?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I'm agreeing. The answer 'Yes' may have been misleading.

You can indeed use the AWT and Swing classes in a web application, the 'headless' option is in case the server is installed without a graphical interface. If this is the case the OS support required by AWT will not be available.

You cannot, however, use AWT or Swing classes in web aapps and send them to the client. To do this you would need to write an Applet.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You could also write an application that uses applets (with or without Swing) that interact with servlets.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Andreas Ecker
Greenhorn

Joined: Jun 13, 2002
Posts: 4
Hi,

using Google I found a link for using Swing in servlets:
http://www.lip.pt/computing/docs/java/jas/jas/Documentation/howto/servlet/default.shtml

Here it's used to create pictures to be sent to the client.

Andreas
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61784
    
  67

The 'yes' answer was very misleading. While you can use just about any Java technology with Servlets, it doesn't always make sense to do so. I guess we'll have to wait for the OP to clarify what it is he is actually trying to accomplish.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
can we write swing applications in servlets


The example of "swing application" above are merely reuse of particular swing related functionalities, not complete enough to consider as a swing application.

You can write a servlet to invoke a swing application to run in server side, but i doubt practically anyone would do that for enterprise applications.


SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlets with swings