Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a problem with running the servlet

 
zohreh talebi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dears,

I have two classes and one of them include main method and this class should run and give the result but i want to show the result by servlet so i cut the main method and paste it to doGet of my servlet but when i run it , it don't give me the result while the class itself run successfully .

Regards
Zohreh
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that you'll have to develop on what you mean by "it don't give me the result". Any exception thrown ? Have you checked the log files ?
 
zohreh talebi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Satos.

the class that it have main method is responsible for showing my webcam picture in a frame and it's work successfully but when i cut the main method and take it in doGet . the servlet only show the frame without any exception and don't detect my webcam.

Zohreh
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say "show a picture in a frame" do you mean a Swing JFrame?
 
zohreh talebi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.the class extends from JFram.
 
zohreh talebi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any idea is great for me.please...
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by zohreh talebi:
yes.the class extends from JFram.


I think you've got some fundamental misunderstandings about the way a servlet app works.

Servlets deliver web content (usually HTML and Javascript) to clients over HTTP. The client (usually a browser) may or may not even be Java enabled.
Often the servers don't have GUIs running.

If you want to run Swing components on the client's machine, you'll need to look into either applets or JWS.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic