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

Java from a web page  RSS feed

 
anna markov
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I wonder if it is possible to make a main class to execute in the server by clicking a submit button in a web page.

greetings
anna
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Do you mean something like a servlet (which is the standard way of executing Java code on a server)?
 
anna markov
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, kind of. I have a some java code in a main class that I need to run whenever a button is clicked.
I understand the button should launch a servlet, and then, should I put the code of the main class in another one the servlet can call?

thanks
anna
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could make it a different class, or you could keep it in the servlet class. It depends a bit on what the class (or method) does, and how big it is.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!