(sorry in advance for all the posts!)
As you can tell, I'm very new (< 2 weeks) to jsp/servlets/tomcat etc.
OK, I need to switch from one JSP page to a second one when a button is clicked. I can fire up a new page this way easily, by defining the button as part of an HTML form block. I just code something like
and all works out well. However, I also want - upon the button being clicked - parameters from another component to be loaded to a javabean for usage in the second page, 2.jsp.
I load the bean as follows:
where "tables" is a multiple-select input component in the same form as the "transform" submit button.
indeed, egregious bean-handling standard-violations aside,
this actually works when I fire up the second page NOT via the "actions=" as above, but with a page-open statement as part of the onClick parameter (appended to the code immediately above). However, the second jsp page is fired up evidently prior to the parms getting set in the bean - for it to display them I need to click twice (there's always that 1-click lag). The first page that pops up doesn't reflect the changes so I close it, re-click and the second one does. IF, however, I do it as above - via the action parm - they aren't recorded at all.
How can I do this? How can I load the parms into my bean AND launch the webpage (preferably not as a popup, but a page-transfer) AND have the new jsp page find the parms?
I've tried a lot of combinations of things, but so far to no avail.
Thank you...
dora
As you can tell, I'm very new (< 2 weeks) to jsp/servlets/tomcat etc.
OK, I need to switch from one JSP page to a second one when a button is clicked. I can fire up a new page this way easily, by defining the button as part of an HTML form block. I just code something like
Code:
<form method=GET
action="[URL unfurl="true"]http://2.jsp">[/URL]
I load the bean as follows:
Code:
<input type="submit"
value="Transform"
onClick="
<%
if ( request.getParameterValues( "tables" ) != null )
{
%>
<jsp:setProperty name="ParmHandlerBean"
property="lTables"
value="<%= Arrays.asList( request.getParameterValues( "tables" ) ) %>"/>
<%
};
%>
where "tables" is a multiple-select input component in the same form as the "transform" submit button.
indeed, egregious bean-handling standard-violations aside,
this actually works when I fire up the second page NOT via the "actions=" as above, but with a page-open statement as part of the onClick parameter (appended to the code immediately above). However, the second jsp page is fired up evidently prior to the parms getting set in the bean - for it to display them I need to click twice (there's always that 1-click lag). The first page that pops up doesn't reflect the changes so I close it, re-click and the second one does. IF, however, I do it as above - via the action parm - they aren't recorded at all.
How can I do this? How can I load the parms into my bean AND launch the webpage (preferably not as a popup, but a page-transfer) AND have the new jsp page find the parms?
I've tried a lot of combinations of things, but so far to no avail.
Thank you...
dora