Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Bean Component in JSP with MySQL as backend


Message #1 by kmadhumadhavi@y... on Tue, 19 Sep 2000 08:28:15 +0100
Hi

Check that you have imported java class, than you can use two approach to
instantiate the bean.
1.
<html>

<%@ page language="java" %>
<%@page import="YourBean",  java.util.Vector %>

<%
  YourBean  yourBean = new YourBean();
Vector results = yourBean.callYourMethod();
%>

or 2.
<html>
<%@ page language="java" %>
<%@page import="YourBean",  java.util.Vector %>
<jsp:useBean id="yourBean" scope="session" class="yourPackage.YourBean" />

<%
Vector results = yourBean.callYourMethod();
%>


I think that <jsp:useBean /> is not supported in older version of JSP, but
JRun 3.0 supports this tag.
And you should install you class in
JRun/servers/yourServer/yourApp/Web-inf/classes/yourPackage/YourBean.class

If you still have the problem print out from jsp and yourBean debugging
info, and you'll find them in logs/yourServer-out.log to see what's the
problem (your code or paths).

good luck
ljubisak

----- Original Message -----
From: <kmadhumadhavi@y...>
To: Pro_JavaServer_Pages <pro_jsp@p...>
Sent: Tuesday, September 19, 2000 12:28 AM
Subject: [pro_jsp] Bean Component in JSP with MySQL as backend


> I am using MySql as backend database.I wrote a bean component and in its
> constructor I have opened connection to database.In it I have several
> methods which involve in retrieving data from database and returning a
> Vector,int etc or inserting into database.I am creating an instance of the
> class file in my jsp file and am accessing various methods in the bean.I
> uploaded the class file into jrun/classes directory and now the methods
> are not getting executed and not returning back any value.I just need a
> help on this topic.Please guide me what to do as quickly as possible.
>
> ---
> Do you know what you want from this list? How would you provide
programmers with the solutions they need? If you have the answers, and are
willing to work in Birmingham (UK), then you could be a List Manager. Please
send CVs and a covering letter to listsupport@p... for further
information.


  Return to Index