我在 SearchTIN.java 类中有这段代码。我想在 jsp中显示tin、name & address的值
public class SearchTIN extends ActionSupport implements ServletRequestAware{
private String tin;
private String name;
private String address;
public String getTpTin() {
return tin;
}
public String getTpName() {
return name;
}
public String getTpAddress() {
return address;
}
public void setTpTin(String tin) {
this.tin = tin;
}
public void setTpName(String name) {
this.name = name;
}
public void setTpAddress(String address) {
this.address = address;
}
public String execute() throws Exception {
Debugger.border();
Debugger.startDebug(this.getClass().toString());
String tax = request.getParameter("tin");
TblTaxPaymentDAO tdao = DAOFactory.getDaoManager(TblTaxPayment.class);
TblTaxPayment t = null;
t = tdao.findbyTIN(tax.replace("-", ""));
TblTaxPayment tbltaxpayment = (TblTaxPayment) t;
try{
Debugger.print("TIN : "+tax);
if(tax != null) {
tin = tbltaxpayment.getTpTin();
name = tbltaxpayment.getTpName();
address = tbltaxpayment.getTpAddress();
}
return SUCCESS;
JSP:锡的值将在输入中,名称将在文本区域名称中,地址将在文本区域地址中。
<form action="searchTIN" name="TIN" method="post" enctype="multipart/form-data">
<div class="TIN">
<div>
<label style="font-size: 17px;">TIN - Branch Code</label><br><br>
<input id="mask" name="tin" type="text" value="" style="margin-top: -9px; width: 170px; float: left;"/>
<div class="buttont" style="float: left; width: 100px; height: 30px; line-height: 30px; margin-left: 4px; margin-top: -12px;">
<a href="javascript:document.TIN.submit();" onclick="rmAlert()">Search</a>;
</div>
<br><br>
<label style="font-size: 17px;">Registered Name</label><br><br>
<textarea disabled id="name" name="name" style="margin-top: -9px; width: 275px; height: 40px;"/><% %></textarea>
<br><br>
<label style="font-size: 17px;">Address</label><br><br>
<textarea disabled id="address" name="address" style="margin-top: -9px; width: 275px; height: 40px;"/></textarea>
<br><br>
</div>