I have written a class in java: "sample.java" under the package name foo
with a method
char check(String,String)
In my Jsp page I wrote the following code:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import ="foo.sample" %>
<%@ page import="java.io.*,java.util.*,java.sql.*" %>
<!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>
<body>
<%!sample obj=new sample(); %>
<%
char a='n';
String name=request.getParameter("usr");
String pass=request.getParameter("psw");
out.print("Welcome "+name);
out.print("pass "+pass);
session.setAttribute("user",name);
a=obj.check(name,pass);
%>
but when I run the code in server, an error is shown as follows
char()
not visible
Can anyone help me with this?