Re: JSP page that display 10 result...

2000-11-16 Thread Chin Sung Kit

hi,

you might want to have a look at this one:
http://jsptags.com/tags/navigation/pager/

thanks.

ced

Marco wrote:

> How to make a JSP page that display 10 result (from a DB) per time and after
> with a next and prev link going forward the result??
> Can anyone explain me to this??
> Ca i have a code that explain this???
> Thanx in advance...
> marks
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



package problem in jsp

2000-11-16 Thread Chin Sung Kit

hi all,

i've written two beans under the package name called jsp

bean 1
Staff.java

bean 2
DatabaseBean.java

when i tried to import Staff, it gave the following error:
Class Staff not found in import.

my DatabaseBean code,
package jsp;

import jsp.Staff; <-- error here

public class DatabaseBean {
}

can someone telll me what's wrong with it?

thanks.

ced

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



jsp include question

2000-11-11 Thread Chin Sung Kit

hi all,

what's the difference between  and <%@include
file="relative URL" %>?

thank you.

ced

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: prepared statement problem

2000-11-08 Thread Chin Sung Kit

hi all,

thanks for your reply. :)

can i use a PreparedStatement to do executeQuery??
from the javadoc, i can only see that they use for executeUpdate?

thanks for any help :)

ced

Synu Jacob Vengal wrote:

> Initialize values as "?" and the add ",?" to it for each of the count in the
> array.
>
> eg:
>
>  String values="?";
>
> if (stud_no==1)value="?";
> else
> for(int i=1;i values=values+",?";
> }
>
> select name, age from student where stud_no in ("+values+")";
>
> Hope this helps,
>
> Bye,
> SJ
>
> - Original Message -
> From: "Chin Sung Kit" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 08, 2000 3:27 PM
> Subject: Re: prepared statement problem
>
> hi,
>
> i have a question on preparedstatement.
>
> i get the parameter values from the form submitted
> String[] stud_no = request.getParameterValues("stud_no");
>
> and the question is how do i set the values into the preparedstatement, for
> i dont
> know how many stud_no is the user going to submit.
>
> select name, age from student where stud_no in (?, ?, ?, ?, ?)
>
> thanks for any help and suggestions.
>
> ced
>
> PIYUSH NIGAM wrote:
>
> > It is essential that your database allows nulls for values not being
> > updated.Also your insert statement must include the field names in which
> you
> > are inserting values:
> > inser into test(name,score) values(?,?)
> > Piyush Nigam
> >
> > -Original Message-
> > From: Synu Jacob Vengal [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, November 08, 2000 10:33 AM
> > To: [EMAIL PROTECTED]
> > Subject: prepared statement problem
> >
> > > > Hi,
> > > > I am using a prepared statement to insert values into the database
> > > fields.
> > > > Is it always necessary that we should insert data in all the fields or
> > > else null values??
> > > > for eg. i gave the sql as
> > > > sql ="INSERT INTO test VALUES(?,?)";
> > > > when the actual table contained 3 fields.
> > > > When i skipped one field it shows the following error
> > > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid
> argument
> > > value
> > > > Pls give me a solution.
> > > > Thanks ,
> > > > SJ
> >
> >
> ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
> >
> ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> "Never let yesterday's disappointments overshadow  tomorrow's dreams"
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

"Never let yesterday's disappointments overshadow  tomorrow's dreams"

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: prepared statement problem

2000-11-08 Thread Chin Sung Kit

hi,

i have a question on preparedstatement.

i get the parameter values from the form submitted
String[] stud_no = request.getParameterValues("stud_no");

and the question is how do i set the values into the preparedstatement, for i dont
know how many stud_no is the user going to submit.

select name, age from student where stud_no in (?, ?, ?, ?, ?)

thanks for any help and suggestions.

ced

PIYUSH NIGAM wrote:

> It is essential that your database allows nulls for values not being
> updated.Also your insert statement must include the field names in which you
> are inserting values:
> inser into test(name,score) values(?,?)
> Piyush Nigam
>
> -Original Message-
> From: Synu Jacob Vengal [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 08, 2000 10:33 AM
> To: [EMAIL PROTECTED]
> Subject: prepared statement problem
>
> > > Hi,
> > > I am using a prepared statement to insert values into the database
> > fields.
> > > Is it always necessary that we should insert data in all the fields or
> > else null values??
> > > for eg. i gave the sql as
> > > sql ="INSERT INTO test VALUES(?,?)";
> > > when the actual table contained 3 fields.
> > > When i skipped one field it shows the following error
> > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid argument
> > value
> > > Pls give me a solution.
> > > Thanks ,
> > > SJ
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



"Never let yesterday's disappointments overshadow  tomorrow's dreams"

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: resultset to jsp

2000-11-06 Thread Chin Sung Kit

hi all,

can i do a query in a resultset again?

thank you.

Sanjay Gomes wrote:

> Keep the connection open for the full session
> Close the connection when the user tries to logout
> Hope this helps
> Sanjay
>
> -Original Message-
> From: Ron Chan [mailto:[EMAIL PROTECTED]]
> Sent: 04 November 2000 14:02
> To: [EMAIL PROTECTED]
> Subject: Re: resultset to jsp
>
> Hi,
>
> 1. you have a bean that does the database query.
> 2. either that bean or a utility, iterates the
> resultset for the column values, puts them into the
> TableModel. put the TableModel into the session.
> 3. In the jsp file, get from the session, and loop to
> display into .
>
> one reason for not using the resultset was my concern
> that the database connection is kept open. Can someone
> confirm whether this is true or not.
>
> thanks,
>
> ron
>
> --- T A Flores <[EMAIL PROTECTED]> wrote:
> > If you use the or JTable how exactly are you
> > getting the result
> > set from the Servlet/Bean?
> >
> > - Original Message -
> > From: Ron Chan <[EMAIL PROTECTED]>
> > Date: Friday, November 3, 2000 5:02 pm
> > Subject: Re: resultset to jsp
> >
> > > Hi,
> > >
> > > why not put the resultset into a TableModel format
> > for
> > > transport. Whatever display, if AppleJTable, if
> > html, can loop
> > > rows and columns into a
> > >  tag. etc.
> > >
> > > ron
> > >
> > >
> > > --- T A Flores <[EMAIL PROTECTED]> wrote:
> > > > It is possible, however, why would you want to
> > use
> > > > and array why not
> > > > use a vector of hashtables.  I posted a response
> > to
> > > > a similiar problem
> > > > using servlet to jsp last month (I believe more
> > > > toward the middle of
> > > > October).  Why don't you search the archive and
> > see
> > > > if that helps you
> > > > at all.
> > > >
> > > > - Original Message -
> > > > From: Ginni <[EMAIL PROTECTED]>
> > > > Date: Monday, January 3, 2000 3:27 pm
> > > > Subject: resultset to jsp
> > > >
> > > > > hi,
> > > > >
> > > > > I query my database and get a resultset in my
> > bean
> > > > , now is it
> > > > > possible to
> > > > > get all the records in the resultset into an
> > > > array. i want to
> > > > > retrieve this
> > > > > array in my jsp and display the values there.
> > is
> > > > that possible
> > > > >
> > > > > there are 2 things here,
> > > > >
> > > > > 1. i need to get the resultset into an array
> > (in
> > > > asp, i use
> > > > > getrows() for
> > > > > this purpose)
> > > > > 2. i need to get the array into my jsp. (could
> > i
> > > > use getProperty
> > > > > for this)
> > > > >
> > > > > thanks for ur time,
> > > > > :-)
> > > > > Have a great Day!
> > > > > -Ginni
> > > > >
> > > > >
> > > >
> > >
> >
> 
> > > > ===
> > > > > To unsubscribe: mailto [EMAIL PROTECTED]
> > with
> > > > body: "signoff
> > > > > JSP-INTEREST".
> > > > > Some relevant FAQs on JSP/Servlets can be
> > found
> > > > at:
> > > > >
> > > > > http://java.sun.com/products/jsp/faq.html
> > > > > http://www.esperanto.org.nz/jsp/jspfaq.html
> > > > >
> > > >
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > > > >
> > > >
> > >
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> > > > >
> > > >
> > > >
> > >
> >
> 
> > ===
> > > > To unsubscribe: mailto [EMAIL PROTECTED]
> > with
> > > > body: "signoff JSP-INTEREST".
> > > > Some relevant FAQs on JSP/Servlets can be found
> > at:
> > > >
> > > >  http://java.sun.com/products/jsp/faq.html
> > > >  http://www.esperanto.org.nz/jsp/jspfaq.html
> > > >
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > > >
> > >
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> > >
> > >
> > > __
> > > Do You Yahoo!?
> > > From homework help to love advice, Yahoo! Experts
> > has your answer.
> > > http://experts.yahoo.com/
> > >
> > >
> >
> 
> > ===
> > > To unsubscribe: mailto [EMAIL PROTECTED] with
> > body: "signoff
> > > JSP-INTEREST".
> > > Some relevant FAQs on JSP/Servlets can be found
> > at:
> > >
> > > http://java.sun.com/products/jsp/faq.html
> > > http://www.esperanto.org.nz/jsp/jspfaq.html
> > >
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > >
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> > >
> >
> >
> ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> > body: "signoff JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> __
> Do You Yahoo!?

Re: Anybody thinking of using JRun just don't.

2000-10-30 Thread Chin Sung Kit

hi,

i plan to buy JRun pro, reading from what u commented, is Jrun really that bad?
appreciate if you can give me some inside-out of jrun.  what about servletexec?

thanks.

ced

Nicholson Robert wrote:

> Configuring this thing is a real pain. Half the time any change in JMC
> stops it subsequently starting up again and I already know that it
> consistently will remove any welcome-file-lists that you define in
> web.xml. In short configuring this thing is a complete joke.
>
> I would mind if everything was consistent but half the time it does
> different things and it's just too darn unstable to work with. Deployment
> is a pain also.
>
> Anybody here pro JRun? I'm not after using it.
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

--

"Never let yesterday's disappointments overshadow  tomorrow's dreams"

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: errorpage.jsp - i found it already

2000-10-30 Thread Chin Sung Kit

hi suresh,

here it is, http://java.sun.com/products/jsp/html/exceptions.fm.html

Suresh kumar K Badiga wrote:

> Hi
> can you tell me where the tutorial if possible give me the web address
>
> -suresh
>
> - Original Message -----
> From: "Chin Sung Kit" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 30, 2000 1:33 PM
> Subject: Re: errorpage.jsp - i found it already
>
> > never mind guys, i found it in the java's tutorial already!
> >
> > thanks :)
> >
> > Chin Sung Kit wrote:
> >
> > > hi all,
> > >
> > > how do i use an errorpage which catches all the exception?
> > >
> > > thanks.
> > >
> > > regards,
> > > ced
> > >
> > > "Never let yesterday's disappointments overshadow  tomorrow's dreams"
> > >
> > >
> ===
> > > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > > Some relevant FAQs on JSP/Servlets can be found at:
> > >
> > >  http://java.sun.com/products/jsp/faq.html
> > >  http://www.esperanto.org.nz/jsp/jspfaq.html
> > >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
> >
> >
> >
> > "Never let yesterday's disappointments overshadow  tomorrow's dreams"
> >
> >
> ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

--

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: errorpage.jsp - i found it already

2000-10-30 Thread Chin Sung Kit

never mind guys, i found it in the java's tutorial already!

thanks :)

Chin Sung Kit wrote:

> hi all,
>
> how do i use an errorpage which catches all the exception?
>
> thanks.
>
> regards,
> ced
>
> "Never let yesterday's disappointments overshadow  tomorrow's dreams"
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets




"Never let yesterday's disappointments overshadow  tomorrow's dreams"

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



errorpage.jsp

2000-10-29 Thread Chin Sung Kit

hi all,

how do i use an errorpage which catches all the exception?

thanks.

regards,
ced

"Never let yesterday's disappointments overshadow  tomorrow's dreams"

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: jsp page not refreshed?

2000-10-28 Thread Chin Sung Kit

deleting the java file in the folder is one of the solution, but it's not workable
in the long run, say what if everytime the user updates the database table and yet
the page is not refreshed?  do i have to delete the java file manually?

there must be some other solution.

Nova Bhojwani wrote:

> when closing Tomcat if working in windows environment
> close all tasks associated to it and then run the
> program..
>
> Also delete the .java file which is created in the
> folder after compilation of the jsp.
>
> --- Chin Sung Kit <[EMAIL PROTECTED]> wrote:
> > hi all,
> >
> > i have this refreshing problem in jsp with tomcat.
> > at first, i deleted
> > some data in my database table , and then i browse
> > to my jsp page, to my
> > surprise the data is still shown on the jsp page
> > even though there's no
> > data inside my database table.  to counter that, i
> > restart tomcat, and
> > again the same data is still shown on the page. why?
> >
> > does anyone has this problem before?
> >
> > thanks for any ideas/suggestions.
> >
> > ced
> >
> >
> ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> > body: "signoff JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> __
> Do You Yahoo!?
> Yahoo! Messenger - Talk while you surf!  It's FREE.
> http://im.yahoo.com/
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

-

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



jsp page not refreshed?

2000-10-27 Thread Chin Sung Kit

hi all,

i have this refreshing problem in jsp with tomcat.  at first, i deleted
some data in my database table , and then i browse to my jsp page, to my
surprise the data is still shown on the jsp page even though there's no
data inside my database table.  to counter that, i restart tomcat, and
again the same data is still shown on the page. why?

does anyone has this problem before?

thanks for any ideas/suggestions.

ced

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: help,invalidate session

2000-10-23 Thread Chin Sung Kit

u mean HttpSession userSession = session.putValue("staffId", staffId); ?
i've done this already.

"Sachin S. Khanna" wrote:

> A better option would be to add a token string to the users session when he
> logs on to your site. And remove the token string from the session when the
> user wishes to log off. Another thing, you would have to check for the token
> string in every jsp page to see whether the user is logged on, if not then
> you must direct the user to the log on page.
> ----- Original Message -
> From: Chin Sung Kit <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 23, 2000 12:39 PM
> Subject: help,invalidate session
>
> > hi,
> >
> > i have a problem invalidating the user's session.
> >
> > i have a  link, if the user clicks on this link, it is supposed
> > to sign out the user - HttpSession.invalidate();
> >
> > my jsp code:
> > <%
> > String signout = request.getParameter("signout");
> > if (signout != null)
> >  userSession.invalidate();
> >  %>
> >
> > i'm using tomcat3.1
> >
> > thanks for any help/suggestion.
> >
> > ced
> >
> > below is the error:
> > Internal Servlet Error:
> >
> > javax.servlet.ServletException:
> > at
> >
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> l.java:386)
> >
> > at
> >
> jsp._0002fjsp_0002fsignin_0002ejspsignin_jsp_23._jspService(_0002fjsp_0002fs
> ignin_0002ejspsignin_jsp_23.java:149)
> >
> > at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java, Compiled
> > Code)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> > Compiled Code)
> > at
> >
> org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
> va,
> > Compiled Code)
> > at
> > org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java,
> > Compiled Code)
> > at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
> > Compiled Code)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ContextManager.service(ContextManager.java,
> > Compiled Code)
> > at
> >
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
> > Compiled Code)
> > at java.lang.Thread.run(Unknown Source)
> >
> > Root cause:
> >
> > java.lang.NullPointerException:
> > at
> >
> jsp._0002fjsp_0002fsignin_0002ejspsignin_jsp_23._jspService(_0002fjsp_0002fs
> ignin_0002ejspsignin_jsp_23.java:136)
> >
> > at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java, Compiled
> > Code)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> > Compiled Code)
> > at
> >
> org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
> va,
> > Compiled Code)
> > at
> > org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java,
> > Compiled Code)
> > at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
> > Compiled Code)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ContextManager.service(ContextManager.java,
> > Compiled Code)
> > at
> >
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
> > Compiled Code)
> > at java.lang.Thread.run(Unknown Source)
> >
> >
> ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http:

help,invalidate session

2000-10-23 Thread Chin Sung Kit

hi,

i have a problem invalidating the user's session.

i have a  link, if the user clicks on this link, it is supposed
to sign out the user - HttpSession.invalidate();

my jsp code:
<%
String signout = request.getParameter("signout");
if (signout != null)
 userSession.invalidate();
 %>

i'm using tomcat3.1

thanks for any help/suggestion.

ced

below is the error:
Internal Servlet Error:

javax.servlet.ServletException:
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)

at
jsp._0002fjsp_0002fsignin_0002ejspsignin_jsp_23._jspService(_0002fjsp_0002fsignin_0002ejspsignin_jsp_23.java:149)

at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java, Compiled
Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java,
Compiled Code)
at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java,
Compiled Code)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java,
Compiled Code)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java,
Compiled Code)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
Compiled Code)
at java.lang.Thread.run(Unknown Source)

Root cause:

java.lang.NullPointerException:
at
jsp._0002fjsp_0002fsignin_0002ejspsignin_jsp_23._jspService(_0002fjsp_0002fsignin_0002ejspsignin_jsp_23.java:136)

at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java, Compiled
Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java,
Compiled Code)
at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java,
Compiled Code)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java,
Compiled Code)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java,
Compiled Code)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
Compiled Code)
at java.lang.Thread.run(Unknown Source)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



help, jsp update database

2000-10-14 Thread Chin Sung Kit

hi all,

i have a jsp page with an update bean.

when i tried to use statement.executeUpdate(), it just hung
there...no response no nothing at all...can someone tell me
what's wrong with my code? below is my code.

thanks in advance.

ced

--

my jsp,

<%
if (request.getParameter("jsp_insert") != null) {
String sNo = request.getParameter("txtStaffNo");
String sName = request.getParameter("txtName");
String sDept = request.getParameter("txtSection");
String UpdateString = "insert into t_staff (staff_no, staff_name,
dept) values ('" + sNo + "','" + sName + "','"  + sDept + "')";
beanConnect.connect();
beanConnect.execUpdate(UpdateString);
}
%>

in my bean,
package jsp;
import java.sql.*;
import java.io.*;

public class DbBean {
 public boolean connect{
   //connection properties..
 }
 public void execUpdate (String queryString) throws SQLException
{
 Statement updStmt = dbCon.createStatement ();
 updStmt.executeUpdate(queryString);
}
} //end of the Dbbean

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



retrive an image in BLOB?

2000-09-28 Thread Chin Sung Kit

hi all,

how to store/retrive an image in BLOB filed in oracle database using JSP
w/ JDBC??

thanks for any suggestions.

ced :)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: jsp login page

2000-09-28 Thread Chin Sung Kit

hi,
thanks for you reply.

yes, there are both in the same file, so what do i need to do in order to counter
this problem?

ced

Dani Clemente wrote:

> Hi
>
> Is there in the same file the scriptlet and de html code?, if so, the
> problem is that the first time the page is requested, both username and
> password don't exist, so when you try gettinf their values, you get null
> and else statement is executed.
>
> I hope this was useful.
>
> Dani
>
> ----- Mensaje Original -
> De: Chin Sung Kit <[EMAIL PROTECTED]>
> Fecha: Jueves, Septiembre 28, 2000 8:46 am
> Asunto: jsp login page
>
> > hi,
> >
> > can anyone point out what is wrong with my code?  when i first
> > load the
> > page, the message, "please fill in the form again, blah blah" already
> > appeared.  i thought i put an ELSE statement there.
> >
> > can anyone shed some light on this?
> >
> > ced
> >
> > below is the jsp code:
> >
> > <%@page language="java" import="java.sql.*, jsp.*, javax.servlet.*"%>
> > 
> > <%@page session="false"%>
> > <%
> > String userId = request.getParameter("username");
> > String password = request.getParameter("password");
> > if ((userId != null) && (password != null)) {
> > String sql = "select userid from t_staff where userid='" + userId +
> > "'and password='" + password +"'";
> > beanConnect.connect();
> > ResultSet rs = beanConnect.execSQL(sql);
> >
> > if (rs.next()) {
> >  HttpSession userSession = request.getSession(true);
> >  userSession.putValue("userName", userId);
> > response.sendRedirect("/test/jsp/home.jsp");
> >}
> > }
> > else {
> > out.println("Please fill in the form again!  You have typed in
> > either the wrong USERID or PASSWORD");
> > }
> > %>
> > 
> > 
> > eDORIS Login
> > 
> >
> > 
> > 
> > 
> >  User Name:
> >
> >  
> >  Password:
> >
> >  
> >  
> >
> >  
> > 
> > 
> > 
> >
> >
> 
> ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



jsp login page

2000-09-28 Thread Chin Sung Kit

hi,

can anyone point out what is wrong with my code?  when i first load the
page, the message, "please fill in the form again, blah blah" already
appeared.  i thought i put an ELSE statement there.

can anyone shed some light on this?

ced

below is the jsp code:

<%@page language="java" import="java.sql.*, jsp.*, javax.servlet.*"%>

<%@page session="false"%>
<%
String userId = request.getParameter("username");
String password = request.getParameter("password");
if ((userId != null) && (password != null)) {
 String sql = "select userid from t_staff where userid='" + userId +
"'and password='" + password +"'";
 beanConnect.connect();
 ResultSet rs = beanConnect.execSQL(sql);

 if (rs.next()) {
  HttpSession userSession = request.getSession(true);
  userSession.putValue("userName", userId);
 response.sendRedirect("/test/jsp/home.jsp");
}
}
else {
 out.println("Please fill in the form again!  You have typed in
either the wrong USERID or PASSWORD");
}
%>


eDORIS Login





  User Name:

  
  Password:

  
  

  




===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



bean scope (application/session)

2000-09-27 Thread Chin Sung Kit

Hi all,

What are the differences between bean scope - application and session?
i read about it from the java doc, it says
application - objects accessible from pages that belong to the same
application
session - objects accessible from pages belonging to the same session as
the in which they created

i still dont get it.

what do ppl normally use for a database connection bean, session or
application scope?

thanks.

ced

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



scope of the Beans?

2000-09-27 Thread Chin Sung Kit

hi,

say if I instantiate one of my beans in my login page, can I still use
it in other pages?

for example:
in my login.jsp, i instantiate the bean.


in my index.jsp, can i use the bean straight off without declaring the
jsp:useBean tag again?

thanks for any suggestions/opinion.

ced

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



error in jsp with beans

2000-09-26 Thread Chin Sung Kit

hi all,

i try to use a connection bean in my jsp.
<%@page language="java" import="java.sql.*, jsp.*"%>


but it gives this error, can anyone tell me what does this error message
imply?

Error: 500
Location: /test/jsp/profile.jsp
Internal Servlet Error:

javax.servlet.ServletException: jsp.DbBean
 at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)

 at
jsp._0002fjsp_0002fprofile_0002ejspprofile_jsp_6._jspService(_0002fjsp_0002fprofile_0002ejspprofile_jsp_6.java:186)

 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.jasp

below is the sample bean:
package jsp;

   import java.sql.*;
   import java.io.*;

public class DbBean {
 String dbURL =
"jdbc:oracle:thin:@ip:port:sid";
 String dbDriver =
"oracle.jdbc.driver.OracleDriver";
 private Connection dbCon;

 public DbBean () {
  super ();
 }

 public boolean connect () throws
ClassNotFoundException, SQLException {
  Class.forName (this.getDbDriver ());
  dbCon = DriverManager.getConnection
(this.getDbURL (), "scott", "tiger");
  return true;
 }

 public void close () throws SQLException {
  dbCon.close ();
 }

 public ResultSet execSQL (String
queryString) throws SQLException {
  Statement stmt = dbCon.createStatement ();

  ResultSet rs = stmt.executeQuery
(queryString);
  return (rs == null) ? null : rs;
 }

 public String getDbDriver () {
  return this.dbDriver;
 }

 public String setDbDriver (String newValue)
{
  return this.dbDriver = newValue;
 }

 public String getDbURL () {
  return this.dbURL;
 }

 public String setDbURL (String newValue) {
  return this.dbURL = newValue;
 }

} //end of the Dbbean

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: help, package problem

2000-09-26 Thread Chin Sung Kit

hi,

thanks for your reply.

i've tried your solution, still it doesn't work.  and i've already set a classpath 
pointing to my
package.

my ConnectionHolder class is located at,
"c:\tomcat\webapps\test\WEB-INF\classes\jsp\com\edoris\classes" and my classpath is 
set to
"c:\tomcat\webapps\test\WEB-INF\classes\jsp;"

and in my JSP, i put down
<%@page import="com.edoris.classes.ConnectionHolder"%>

tomcat gives me this error, "org.apache.jasper.JasperException: Unable to compile 
class for
JSPF:\Program
Files\tomcat\work\localhost_8080%2Ftest\_0002fjsp_0002fprofile_0002ejspprofile_jsp_10.java:16:
Package com.edoris.classes not found in import.
import com.edoris.classes.ConnectionHolder";

can anyone shed some light on this one?  i know my question may sound stupid though.

thanks in advance.

ccsk

Kachana Ung wrote:

> Add the following to your jsp page:
>
> <%@ page import="yourpackagename.ConnectionHolder"%>
>
> Kachana
>
> --- Chin Sung Kit <[EMAIL PROTECTED]> wrote:
> > hi,
> >
> > i have a login servlet, which validates the username
> > and from there i
> > created the connection for that user.  the username
> > and connection are
> > stored in the session.  i got this ConnectionHolder
> > class from Jason
> > Hunter's book.
> >
> > userSession.putValue("userName", uName);
> > userSession.putValue("userName.connection", holder);
> >
> > And in one of my jsp pages, I need to use this
> > ConnectionHolder, what I
> > did was:
> > <%@page language="java" import="java.sql.*"%>
> > <%ConnectionHolder
> >
> holder=(ConnectionHolder)session.getValue("userName.connection");
> > if (holder != null)
> > Connection conProfile = holder.getConnection();
> > %>
> >
> > It gives me this error,
> > "rg.apache.jasper.JasperException: Unable to
> > compile class for JSPF:\Program
> >
> 
>files\tomcat\work\localhost_8080%2Ftest\_0002fjsp_0002fprofile_0002ejspprofile_jsp_10.java:64:
> > Class jsp.ConnectionHolder
> > not found.
> >
> > How do I go about in getting the ConnectionHolder to
> > work in my JSP?
> >
> > Thanks.
> >
> > cedric
> >
> > Below is the ConnectionHolder classs:
> >
> > class ConnectionHolder implements
> > HttpSessionBindingListener {
> >  private Connection con = null;
> >
> >  public ConnectionHolder (Connection con) {
> >   //save the connection
> >   this.con = con;
> >   try {
> >con.setAutoCommit (false);  //transactions can
> > extend between web
> > pages!
> >   }
> >   catch (SQLException e) {
> >//perform error handling
> >   }
> >  }
> >
> >  public Connection getConnection() {
> >   return con;
> >  }
> >
> >  public void valueBound (HttpSessionBindingEvent
> > event){
> >   //do nothing when added to a session
> >  }
> >
> >  public void valueUnbound (HttpSessionBindingEvent
> > event){
> >   //roll back changes when removed from a session
> >   // (or when the session expires)
> >   try {
> >if (con!=null) {
> > con.rollback();  //abandon any uncommitted data
> > con.close();
> >}
> >   }
> >   catch (SQLException e){
> >//report it
> >   }
> >  }
> > }
> >
> >
> ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> > body: "signoff JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> __
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



help, database connection object stored in session

2000-09-26 Thread Chin Sung Kit

hi,

i have a login servlet, which validates the username and from there i
created the connection for that user.  the username and connection are
stored in the session.  i got this ConnectionHolder class from Jason
Hunter's book.

userSession.putValue("userName", uName);
userSession.putValue("userName.connection", holder);

And in one of my jsp pages, I need to use this ConnectionHolder, what I
did was:
<%@page language="java" import="java.sql.*"%>
<%ConnectionHolder
holder=(ConnectionHolder)session.getValue("userName.connection");
if (holder != null)
Connection conProfile = holder.getConnection(); %>

It gives me this error, "rg.apache.jasper.JasperException: Unable to
compile class for JSPF:\Program
files\tomcat\work\localhost_8080%2Ftest\_0002fjsp_0002fprofile_0002ejspprofile_jsp_10.java:64:
Class jsp.ConnectionHolder
not found.

How do I go about in getting the ConnectionHolder to work in my JSP?

Thanks.

cedric

Below is the ConnectionHolder classs:

class ConnectionHolder implements HttpSessionBindingListener {
 private Connection con = null;

 public ConnectionHolder (Connection con) {
  //save the connection
  this.con = con;
  try {
   con.setAutoCommit (false);  //transactions can extend between web
pages!
  }
  catch (SQLException e) {
   //perform error handling
  }
 }

 public Connection getConnection() {
  return con;
 }

 public void valueBound (HttpSessionBindingEvent event){
  //do nothing when added to a session
 }

 public void valueUnbound (HttpSessionBindingEvent event){
  //roll back changes when removed from a session
  // (or when the session expires)
  try {
   if (con!=null) {
con.rollback();  //abandon any uncommitted data
con.close();
   }
  }
  catch (SQLException e){
   //report it
  }
 }
}

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



jsp with javabeans, a must?

2000-09-22 Thread Chin Sung Kit

hi,

need you opinion, is it a must to use javabeans in jsp?

thanks.

ced

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets