Thanks for the reply Carl. Have amended my profile to comply with naming convention, sorry about that.
Here is the JSP that calls the MailBean:
<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %>
<%@ page language="java" import="ariel.MailDetails, java.util.*,
java.sql.*,
oracle.jdbc.driver.*" %>
<jsp:useBean id="signon" scope="session" class="ariel.LogonBean" />
<jsp:useBean id="bank" scope="request" class="ariel.BankingBean" />
<jsp:useBean id="mailer" scope="request" class="ariel.MailBean" />
<%
//transfer.jsp is used to update the database with details of a funds
transfer
//and to send a confirmatory email to the user
%>
<oui:wml>
<%
String strId = request.getParameter("id");
String strFrom = request.getParameter("from");
String strTo = request.getParameter("to");
String strAmount = request.getParameter("amt");
String strDate = request.getParameter("date");
Hashtable hashtable = new Hashtable();
hashtable = bank.getMail(strId);
if ( request.getParameter("amt") == null)
{
%>
<oui:card id="error" title="Amount error">
<oui:p align="left">
Transfer amount must be submitted. Please go back.
</oui:p>
</oui:card>
<%
}
else if ( request.getParameter("from")==null ||
request.getParameter("to")
==null )
{
%>
<oui:card id="error" title="A/c error">
<oui:p align="left">
Both accounts must be selected. Please go back.
</oui:p>
</oui:card>
<%
}
else
{
Connection conn = null;
try{
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
String url = "jdbc:oracle:thin:ariel/ariel@127.0.0.1:1521:ariel" ;
conn = DriverManager.getConnection( url );
System.out.println("1");
PreparedStatement stmt = conn.prepareStatement ("{call
P_FUNDS_TRANSFER(?,?,?)}");
System.out.println("2");
stmt.setString(1, request.getParameter("from"));
System.out.println("3");
stmt.setString(2, request.getParameter("to"));
System.out.println("4");
stmt.setFloat(3, new Float(request.getParameter("amt")).floatValue()
);
System.out.println("5");
stmt.execute();
System.out.println("6");
%>
<oui:card id="transconfirm" title="Transfer Funds">
<oui:p align="left">
<oui:img alt="Done" localsrc="checkmark1" src ="" >
</oui:img>
Successful transaction completion.
<oui:hr/>
<oui:primary_path short_label="Balances">
<oui:go href='<%="balance.jsp?id=" + strId%>'/>
</oui:primary_path>
<oui:secondary_path short_label="Main">
<oui:go href='<%="../asignon/revalidate.jsp?id=" +
strId%>'/>
</oui:secondary_path>
</oui:p>
</oui:card>
<%
MailDetails md = new MailDetails();
for (Enumeration e = hashtable.elements() ;
e.hasMoreElements() ;)
{
md = (MailDetails) e.nextElement();
mailer.sendMail ( md.getMail(), "bank app.", "10.82.64.9",
"Successful transfer.", true );
}
}
catch(SQLException e)
{
out.println("SQLException: " + e.getMessage() + "*");
while((e = e.getNextException()) != null)
out.println(e.getMessage() + "*");
}
finally
{
//Clean up resources, close the connection.
if(conn != null)
{
try
{
conn.close();
}
catch (Exception ignored) {}
}
}
}
%>
</oui:wml>