File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Java from a web page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java from a web page" Watch "Java from a web page" New topic
Author

Java from a web page

anna markov
Greenhorn

Joined: May 05, 2009
Posts: 2
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
Marshal

Joined: Mar 22, 2005
Posts: 41101
    
  45
Welcome to JavaRanch.

Do you mean something like a servlet (which is the standard way of executing Java code on a server)?


Ping & DNS - my free Android networking tools app
anna markov
Greenhorn

Joined: May 05, 2009
Posts: 2
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
Marshal

Joined: Mar 22, 2005
Posts: 41101
    
  45
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java from a web page
 
Similar Threads
Printing Crystal Rpt on client side in ASP pg
coding for response to enter button on keyboard
start/stop tomcat
To put 2 applets on Web page
suggest books (urgent)