Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why it impossible to use Swing components in JSPs?  RSS feed

 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or it is?
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, not exactly unless you use an applet for your display. JSP runs on the server and that's where the output to be displayed to the client (your browser) is generated.


------------------
Bosun
SCJP for the Java� 2 Platform
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bosun, thanks
I did not quite understand when it is possible nad NOT possible to use Swing components.
Usually the result of JSP is shown in client's browser. OK, it is just a program and if it supports Java's libraries/plug-ins, why it is impossible to have there Swing components?
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the JSP's output is HTML, which is a static mechanism. You can have a servlet/JSP output a page with a java applet embedded in it and the applet can use Swing, but JSPs are not interactive processes. In fact, about the closest you can get to an interactive JSP is to have the client running an applet and have the applet tunnel HTTP requests.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!