问题
In my menu.jsp:
<s:url id="ajaxTest" value="addCustoInfo"/>
<sx:a id="link3" href="%{ajaxTest}" targets="main-content">
Update Content
</sx:a>
in my struts:
<action name="addCustoInfo" method="renderAddCustomerInfo"
class="customerInfoAction">
<result name="success">/page/addCustoInfo.jsp</result>
<result name="empty">/page/addCustoType.jsp</result>
</action>
in my CustomerAction:
@SuppressWarnings("unchecked")
public String renderAddCustomerInfo(){
this.listCustomerType = daoManager.listCustomerType();
if(this.listCustomerType.size() <= 0){
this.session.put("error", "Empty customer type.");
return "empty";
}else{
this.customerInfo = new CustomerInfo();
return SUCCESS;
}
}
in addCustoInfo.jsp:
<form id="addCustoInfo" action="saveCustoInfo" method="post">
<fieldset>
<p>
<label>Customer Type</label> <select name="idCustoType">
<s:iterator value="listCustomerType" status="s">
<option value='<s:property value="customerTypeId" />'>
<s:property value="customerDesc" />
</option>
</s:iterator>
</select>
</p>
<p>
<label>Customer Name<br></label> <input name="customerInfo.name" type="text" class="required" minlength="8">
</p>
<p>
The form addCustoInfo.jsp success to display, but dropdown idCustoType
didn't display anything whereas listCustomerType
size more than one. It's maybe caused of active url. In this case, active url is not change even when I click Update Content link.
How can I resolve this. I'd really appreciate your solution.
Thanks.
来源:https://stackoverflow.com/questions/8179353/remote-link-ajax-struts