hi
you can do it
see the similar example of my code
regards
amit
<%@ page import="java.util.*, java.lang.*, java.io.*" %>
<%@ page import = "amit.*" %>
<html>
<body>
<%! amit.Format format = new amit.Format(); %>
<%! String str = new String(); %>
<%
byte []b;
try
{
java.io.FileInputStream fin = new
java.io.FileInputStream("examples/jsp/login/mesg.def");
int size = fin.available();
b = new byte[size];
fin.read(b);
fin.close();
str = new String(b);
str = format.toHtml(str);
}
catch(java.io.FileNotFoundException fnfe)
{
str = "<font color=\"#0000FF\">Server Error:</font> \n" +
"<em>Could not load guestbook from server</em>";
}
catch(java.io.IOException ioe)
{
str = "<font color=\"#0000FF\">Server Error:</font> \n" +
"<em>Could not read guestbook data</em>";
}
%>
<%= str %>
</html>
</body>
:-) Amit Ghaste
@ 3181
> -----Original Message-----
> From: Reeta Mittal [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, November 24, 1999 4:52 PM
> To: [EMAIL PROTECTED]
> Subject: JSP- Accessing Java Classes
>
> Hello Everyone,
>
> I am facing a problem while using classes. Can anyone help me out ?
> I am having a java class. When I tries to access it using usebean tag of
> Jsp then it works fine but if i tries to access it as a class using "new
> classname" way of java then I am getting error.
> I am attaching the code. Can anyone help me ?
>
> <%@ page import = "login.ValidateUser" %>
>
> <html>
> <head><title>CCMS
> Login</title></head>
> <body bgcolor="white">
> <font size=4>
> <%
> validate = new login.ValidateUser(); ---- This is the place
> where I am creating an instance of
> class
> validate.DSN = "test"
> validate.UID = "";
> validate.PWD ="";
> validate.userid = "reeta";
> validate.password = "reeta";
> if (validate.Success() == "1") { %>
> Valid User !!!!
> <% } else { %>
> Not
> a valid User !!! Try Again.
>
> <form method=get>
> User Id : <input
> type=text name=userid>
> Password:<input type=text name=password>
> <input type=submit
> value="Submit">
> </form>
>
> <% } %>
>
> </font>
> </body>
> </html>
>
> Regards,
> Reeta
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html