You could also do it by using setParameter() instead of setAttribute! I
think! aNYWAY GIVE IT A SHOT!
Naveen Malik
<nzmalik@ALTUSWOR To: [EMAIL PROTECTED]
KS.COM> cc:
Sent by: A Subject: Re: Passing objects from JSP
to JSP
mailing list
about Java Server
Pages
specification and
reference
<JSP-INTEREST@JAV
A.SUN.COM>
05/03/00 12:08 AM
Please respond to
A mailing list
about Java Server
Pages
specification and
reference
I'm new to JSP but I think one solution would be to get away from the
get/set Attribute and use a bean. Either that or use forms to submit the
data with post or get.
Naveen
----- Original Message -----
From: "Nathan Jantz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 02, 2000 1:59 PM
Subject: Passing objects from JSP to JSP
> Hi all,
> I'm interested in being able to pass objects from jsp to jsp using the
> setAttribute() and getAttribute() methods without the use of a controller
> servlet or bean but have been unsuccessful. Here is some code that I
have
> tried:
>
> callingPage.jsp:
>
> <%
> String[] arrayOfString = new String[10];
> request.setAttribute("myStringArray", arrayOfString);
> %>
>
> <html>
> <body>
> <A HREF="receivingPage.jsp">Receiving Page</A>
> </body>
> </html>
>
> ------------------
> receivingPage.jsp:
>
> <% String[] arrayOfString =
(String[])request.getAttribute("myStringArray");
> %>
> <html>
> <body>
> <% if (arrayOfString == null) { %>
> Null array!
> <% } else { %>
> Array Size: <%= arrayOfString.length %>
> <% } %>
> </body>
> </html>
>
> But the arrayOfString object returns null in the receiving page. Why is
> this? Of course in this example the string array is empty but it should
at
> least return me a length of 10, correct? I've searched the archive to
avail
> other than reference to session.putValue() and session.getValue() methods
> which is not what i want.
>
> Any help on this would be great. Thank you!
>
> Nathan
>
>
===========================================================================
> 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