Hi,
I have two JSP pages, and I'm attempting to communicate between them via a javabean.
At the top of the first page, I declare my bean as so:
If certain conditions prevail, I launch the second JSP page via a button-click as so:
In the second JSP page ("response.jsp", I attempt to use the parms contained within the bean as so:
when the second page launches after the button-click, an error is returned mentioning that "ParmHandlerBean" is unrecognized as a variable. If, however, I try to "use" the bean in JSP page 2 ("response.jsp" I generate immediate errors, with the following message:
"jsp.error.useBean.duplicate"
Now, If I attempt to reference the bean in this fashion within the first JSP page (the one in which it's "used", things work fine. They also work fine if I "<@ include" jsp page number 2 in the first page, instead of launching it when the button is clicked.
Hmmmmm, I've played around with the scope parameter of the use-bean tag, but to no avail. I would assume that this can be done (sharing bean instances across JSP pages), but what am I doing wrong?
Thanks!!
Dora
I have two JSP pages, and I'm attempting to communicate between them via a javabean.
At the top of the first page, I declare my bean as so:
Code:
<jsp:useBean id="ParmHandlerBean"
scope="application"
class="mypackage.cParmHandlerBean" />
If certain conditions prevail, I launch the second JSP page via a button-click as so:
Code:
<input type="submit"
value="Transform"
onClick="window.open('response.jsp')">
In the second JSP page ("response.jsp", I attempt to use the parms contained within the bean as so:
Code:
//within a scriptlet...
String sParm = ParmHandlerBean.getParm;
when the second page launches after the button-click, an error is returned mentioning that "ParmHandlerBean" is unrecognized as a variable. If, however, I try to "use" the bean in JSP page 2 ("response.jsp" I generate immediate errors, with the following message:
"jsp.error.useBean.duplicate"
Now, If I attempt to reference the bean in this fashion within the first JSP page (the one in which it's "used", things work fine. They also work fine if I "<@ include" jsp page number 2 in the first page, instead of launching it when the button is clicked.
Hmmmmm, I've played around with the scope parameter of the use-bean tag, but to no avail. I would assume that this can be done (sharing bean instances across JSP pages), but what am I doing wrong?
Thanks!!
Dora