【发布时间】:2014-06-01 00:47:20
【问题描述】:
我有一个包含五个选项卡的表单。在其中一个选项卡(background.jsp)中更改复选框(选中或未选中)我试图将jsp中的(hasGenderChanged)标志设置为true并使用请求类型将其发送到我的java代码。
下面是代码结构。我收到一条错误消息:在edit_Education.jsp 的任何范围内都找不到bean org.apache.struts.taglib.html.BEAN。下面是代码结构。任何帮助将不胜感激。
Introduction.jsp 包含所有标题选项卡,并且在它的末尾有 单击此页面中的保存按钮时,如果在填写表格期间更改了复选框,我想发送。如果更改想要从 JSP 向 java 组件发送 true。
在edit_Education.jsp中:
<template: insert template='education/Introduction.jsp'>
<logic:equal name="educationForm" property="selectedOption" value="0">
<template:put name='content-area' content='education/background.jsp'/>
</logic:equal>
<logic:equal name="educationForm" property="selectedOption" value="1">
<template:put name='content-area' content='education/eduqualification.jsp'/>
</logic:equal>
<logic:equal name="educationForm" property="selectedOption" value="2">
<template:put name='content-area' content='education/workexperience.jsp'/>
</logic:equal>
</template: insert
由于每个选项卡上的表单都很大,我只想在 background.jsp 中的复选框已成为复选框时触发操作
在后台.jsp中
在复选框的 html 标签内,这是我拥有的功能
<script>
function validate(){
document.educationForm.hasGenderChanged.value="true";
}
<html:form action="/processEducationAction" target="CONTENT-AREA">
<html: hidden property="hasGenderChanged"/>
<input type="hidden" name="hasGenderChanged" value="" scope="request"/>
</script>
<TR>
<html:checkbox property="selectOptions.selectGender" onchange="validate()"/>
<bean:message key="education.selectedOptions.label.selectGender"/>
<TR>
</html:form>
在educationForm.java 我有一个布尔hasGenderChanged;用于此的变量以及 setter 和 getter。
我不确定如何在 edit_Education.jsp 中设置 background.jsp 中的 hasGenderChanged 值。
我是 Struts 的新手。在此先感谢您的帮助。
【问题讨论】: