You would pass the bean instance and session object as parameters in a JSP
function (called a method).

For Example, you would say:
<jsp:useBean id="chk" scope="page" class="Alpine.chkBean" />
<%!
  int chkID(String strBar, Alpine.chkBean chk,
          javax.servlet.http.HttpSession session)
  {
      Session session;
      String strID=""+session.getValue("ID");
      String strPassword=""+session.getValue("Password");
      int flag;
      flag=chk.chkID(strID,strPassword,strBar);
      if(flag==1)
         return 1;
      else
         return 0;

  }%>
Eric R. Dunstan
A.D.2000

>From: karen <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: how to use Session in a jsp function?
>Date: Wed, 31 May 2000 14:17:38 +0800
>
>hello,just as you say,to use out.println() method,we need to add like this
>func(JspWriter out)
>{
>}
>if I want to use a Session method,just as session.putValue() or
>session.getValue(),how can I realize?and more if I can call a bean in a jsp
>function?just like below:
>
><jsp:useBean id="chk" scope="page" class="Alpine.chkBean" />
><%!
>  int chkID(String strBar)
>  {
>      Session session;
>      String strID=""+session.getValue("ID");
>      String strPassword=""+session.getValue("Password");
>      int flag;
>      flag=chk.chkID(strID,strPassword,strBar);
>      if(flag==1)
>         return 1;
>      else
>         return 0;
>
>  }%>
>
>Thanks a lot!
>
>===========================================================================
>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

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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

Reply via email to