how to run a java rmi program in the property of a jsp button <pre><code> &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%&gt; &lt;%@page import="com.studytrails.tutorials.springremotingrmiclient.TestSpringRemotingRmi" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt; &lt;title&gt;Insert title here&lt;/title&gt; &lt;/head&gt; &lt;body bgcolor="red"&gt; &lt;h1&gt;&lt;font color=blue&gt;login successfull&lt;/font&gt;&lt;/h1&gt; &lt;h2&gt;&lt;font color="lightgreen"&gt; &lt;form action="${pageContext.request.contextPath}/MyServlet" method="post"&gt; &lt;input type=submit name="n1" value="Click here to play the video"&gt; &lt;/form&gt; &lt;/h2&gt; &lt;/body&gt; &lt;/html&gt; Need to run the below program when clicking the button in jsp file. package com.studytrails.tutorials.springremotingrmiclient; import java.io.*; import java.io.File.*; import java.net.Socket; import java.net.UnknownHostException; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.core.io.Resource; import com.studytrails.tutorials.springremotingrmiserver.*; public class TestSpringRemotingRmi { public static void main(String[] args) throws IOException { ApplicationContext context = new ClassPathXmlApplicationContext("spring-config-client.xml"); GreetingService greetingService = (GreetingService)context.getBean("greetingService"); String greetingMessage = greetingService.getGreeting("Alpha"); System.out.println("The greeting message is : " + greetingMessage); greetingService.getText(); } } </code></pre> <p>In above program I am trying to run java <code>TestSpringRemotingRmi</code> class in the time of button click performed in jsp file. MyServlet file contains the code for process the request from jsp file. but I try to call the default constructor of that call using jsp but it does not work. guide me to solve this problem. </p>