this is my jsp page codeing.. <%@ page import="aaaas.com.Admin" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>SuperbCoupons.com</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <form action="?checklogin" name="login"> User <input type="text" name="txtUser"> Password <input type="text" name="txtPwd"> <input type="submit" name="submit" value="Check"> <% Admin a; a = new Admin(); String iAdminName = a.getAdminName(); String iAdminPwd = a.getAdminPwd(); if (request.getParameter("submit") == "Check") { %> Basit <% } %> </form> </body> </html> HTML: this is my java class... package aaaas.com; /** * Created by IntelliJ IDEA. * User: Administrator * Date: Dec 26, 2009 * Time: 3:30:53 AM */ public class Admin { private String adminName; private String adminPwd; public String getAdminName() { adminName = "admin"; return adminName; } public String getAdminPwd() { adminPwd = "basit"; return adminPwd; } } Code (markup): how should i call this class?
METHOD 1: Deploy the .class file(s) in your webapp's WEB-INF/class directory. METHOD 2: Create a JAR file containing the .class file(s) and deploy the JAR file in your webapp's WEB-INF/lib directory. With both methods, you will be able to call it as below. <% Hello h = new Hello(); out.print(h.say()); %>