Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlets with swings

 
trinadh reddy
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we write swing applications in servlets
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it's possible. Do not forget to use option headless if servlet runs on Unix boxes.
 
trinadh reddy
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where can i find sample code to include swing applications in servlets
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by trinadh reddy:
can we write swing applications in servlets


I would say, No.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want a GUI component that runs on the server?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also write an application that uses applets (with or without Swing) that interact with servlets.
 
Andreas Ecker
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic