我正在使用struts2-jquery打开一个Dialog Widget页面,其中有一个用于编辑类别的表单。
Category包含两个与之关联的字段: name和description。
我想向JSP页面传递一个categoryId,这样表单就可以通过remoteurl预先填充。
<s:url id="cat1" var="remoteurl" action="editCategoryWindow"/>
<sj:dialog id="editCategoryDialog"
autoOpen="false"
height="auto"
width="auto"
modal="true"
href="%{remoteurl}"
title="Edit Category"/>function editCategory(categoryId) {
$('#cat1').attr('categoryId');
$('#editCategoryDialog').dialog({
autoOpen: false,
modal: true,
height: 500,
width: 900
});
$('#editCategoryDialog').empty().data('categoryId', categoryId).dialog("open");
}这不起作用:因为JSP页面上没有categoryId,所以有一个空指针异常。
我应该如何将参数传递给JSP页面?
发布于 2012-07-24 07:56:57
使用以下类别构建URL:
<s:url id="cat1" var="remoteurl" action="editCategoryWindow">
<s:param name="categoryId" value="%{whatever}"/>
</s:url>https://stackoverflow.com/questions/11612128
复制相似问题