File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Where do i place the .class files? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Where do i place the .class files?" Watch "Where do i place the .class files?" New topic
Author

Where do i place the .class files?

Reena Angane
Greenhorn

Joined: Apr 07, 2003
Posts: 2
Hi
I am beginner for JSP and I just tried a simple problem which needs 3 Files:
1. An HTML File which acts as a form to accept details from user
2. A JSP file to pass on the details to the java bean (.class file)for further verification
3.A java file wheich basically is a bean, that checks if the details entered are existing in the back-end(sql table)
I am using j2sdkee1.3.1 and jdk1.3.1_07
I have placed the .jsp and .htm files in the public_html folder but do not know where should I place the .class file. In the previous versions of j2sdkee, the .class files had to be placed inn the /lib/classes folder. In the version that I am using there is no such folder in the lib dir.
Pls help me with this problem
Regards
Reena
Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
which application server r u using?
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
It doesn't matter which Application Server you are running. The J2EE standard states that the classes should be in the WEB_INF/classes directory in your Web Application or in the WEB_INF/lib directory if they have been packaged into JAR files.
HTH


Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
Reena Angane
Greenhorn

Joined: Apr 07, 2003
Posts: 2
I am giving my program codes below:
1. Form.htm
<html>
<head><title>User Validation</title></head>
<body>
<form method="post" action="Validate.jsp">
<center>
<table border="0" cellspacing="2" cellpadding="0">
<tr>
<td colspan="2"><font face="Arial" size="2"><b>Please Fill Up The Details</b></font></td>
</tr>
<tr>
<td><font face="Arial" size="2">Account ID:</font></td>
<td><input type="text" name="accid" size="10"></td>
</tr>
<tr>
<td><font face="Arial" size="2">Pin No:</font></td>
<td><input type="text" name="pin" size="10"></td>
</tr>
<tr>
<td colspan="2"><font size="1" face="verdana"> </font></td>
</tr>
<tr>
<td><input type="submit" value="SUBMIT"></td>
<td><input type="reset" value="RESET"></td>
</tr>
</table>
</center>
</form>
</body>
</html>
2.Validate.jsp
<%@ page language="java" %>
<jsp:useBean id="VA" scope="application" class="Validate" />
<jsp:setProperty name="VA" property="accid" param="accid" />
<jsp:setProperty name="VA" property="pin" param="pin" />
<html>
<head><title>Status</title></head>
<body>
<%
String accid=VA.getAccID();
String pin=VA.getPin();
boolean valid=VA.validDetails();
if(valid==true)
{
out.println("Valid Details Entered!!!");
}
else
{
out.println("Invalid Details Entered...");
}
%>
</body>
</html>
3.Validate.java
import java.io.*;
import java.sql.*;
public class Validate
{
private String accid="";
private String pin="";
Connection connect=null;
Statement stat=null;
ResultSet result=null;
public void setAccID(String accid)
{
this.accid=accid;
}
public void setPin(String pin)
{
this.pin=pin;
}
public String getAccID()
{
return accid;
}
public String getPin()
{
return pin;
}
public Validate() throws ClassNotFoundException
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
public boolean validDetails()
{
boolean valid=false;
String pinNo="";
try
{
accid=getAccID();
pin=getPin();
connect =DriverManager.getConnection("jdbc dbc SN","sa","");
String str="select vPinNo from login where vAccountNo='"+accid+"'";
stat=connect.createStatement();
ResultSet result=stat.executeQuery(str);
while(result.next())
{
pinNo=result.getString(1);
}
pinNo=pinNo.trim();
pin=pin.trim();
if(pinNo.equals(pin))
{
valid=true;
}
}
catch(Exception e)
{
}
return valid;
}
}
Pls tell me how would u execute this program?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where do i place the .class files?