0

am trying to write my first web application so if there are any silly mistakes / questions please excuse

I am trying to put 2 buttons in my web application page, I want to call a class which is there in my src Directory in eclipse, I tried importing the class and then called the function in button onclick method but this doesn't seems to work am confused and I don't know what else to try

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"pageEncoding="ISO-8859-1"%>   
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
            <title>Insert title here</title>
        </head>
        <link href="main.css" rel="stylesheet" type="text/css" />
            <body>
                <form action="">
                    <table>
                        <tr>
                            <td>UserName : </td>
                            <td>
                                <input type="text" name="userName" id="userName">
                            </td>
                        </tr>
                        <tr>
                            <td>Password : </td>
                            <td>
                                <input type="password" name="password" id="password">
                            </td>
                        </tr>
                        <tr>
                            <td>Build Number : </td>
                            <td>
                                <input type="text" name="buildNumber" id="buildNumber">
                            </td>
                        </tr>
                        <tr>
                            <td>Previous Build Number : </td>
                            <td>
                                <input type="text" name="perviousBuild" id="perviousBuild">
                            </td>
                        </tr>
                        <tr>
                            <td>Integ SCR</td>
                            <td>
                                <input type="text" id="integScr" name="IntegScr">
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>
                        <tr>
                            <td>
                                <input type="button" value="Test Connection" id="test" onclick="test()">
                            </td>
                            <td>
                                <input type="button" value="Start Build" id="start" onclick="start()">
                            </td>
                        </tr>
                    </table>
                </form>
            </body>
        </html>


This is the class that has java methods

public class OnClickTest {
    public void test()
    {
        System.out.println("Test");
    }
    public void start()
    {
        System.out.println("Start");
    }
}
Rohan Lopes
  • 165
  • 7
  • 18
manasa
  • 19
  • 1
  • 1
  • 9

0 Answers0