Louis,

You don't have to use a bean tag.  You can declare an array variable in a
jsp page just like you can in a Java class, and then start using it in your
jsp page. If you need to pass the data to another jsp page, you just save it
in the session object.  For example:


<body>
<%
//declare local members of public void _jspService(HttpServletRequest
request, HttpServletResponse response) method of servlet class

        String[] MICRValues = new String[2];

//write out the data to your server's log file, or to HMTL if prefered.
        MICR1 = MICRValues[0];
        System.out.println("MICR1 ="  + MICR1);
      MICR2 = MICRValues[1];
        System.out.println("MICR2 =" + MICR2);

//save data to session object
        session.setAttribute("MICRValues", MICRValues);
<body>



 You can also declare a Java class bean the same way.

//declare local members of public void _jspService(HttpServletRequest
request, HttpServletResponse response) method of servlet class

        OrdersClass Orders;  //where OrdersClass is a java class bean I
created

        //get Orders from session object.
        Orders = (OrdersClass)session.getAttribute("Orders");

        //get me the count, which is a method defined in the orders class.
        count = Orders.size();

The bean tag is just a shortcut way of declaring a local variable in a jsp
page.  Personally, I don't use the bean tag very often, I prefer to declare
my variables at the top of my jsp page, and then use them as necessary.

Hope this info helps.

Celeste



-----Original Message-----
From: Rajinder Sandhu [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 11, 2002 5:16 AM
To: [EMAIL PROTECTED]
Subject: Re: Can I declare array in <jsp:useBean> tag?


this is compile time, not run time.
so this is not possible.





-----Original Message-----
From: Louis Voo [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 11, 2002 4:40 PM
To: [EMAIL PROTECTED]
Subject: Can I declare array in <jsp:useBean> tag?


Hi,

    I want to declare an array object in <jsp:useBean> tag, is it possible?
for example i can declare
<jsp:useBean id="msgbeans" scope="session" class="MessageBean" />
but how to make the msgbeans variable become array?



Regards,
Louis

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to