I want to foward from a JSP page to an action class or servlet:
<%@ taglib uri="/bean" prefix="bean" %>
<%@ taglib uri="/html" prefix="html" %>
<%@ taglib uri="/logic" prefix="logic" %>
<html>
<jsp:useBean id="concordanceForm"
class="Concordance.ConcordanceForm"
scope="request">
</jsp:useBean>
<head>
<script type="text/javascript">
function next()
{ //foward to action class
<html:hidden property="option" value="next" />
<jsp:forward page="/concordance.do" />
}
</script>
</head>
<body>
<bean:write name="concordanceForm" property="concordance"/>
<html:submit onclick="next();">NEXT</html:submit>
//call the function to forward to the action class when button clicked
</body>
</html>
I've tried the above code for the jsp page, but it always comes up with a
java.lang.StackOverflowError.
It's as if it's forwarding to the action class when the jsp page loads, instead of when I click the button (thus creating a never-ending loop).
Does anybody know how to solve the problem and get it to forward to the action class when I click the button?
Thanks in advance for any help,
Chris