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