• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaytag decorator problem in struts

 
rodgers tang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I use displaytag decorator to link table. After creating getLink() class, I start this web page. But this page become blank.I do not why.

Thanks for help.

H Tang
 
Ann Maria
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please forward the <display:table> code,getLink() code and the action from you get the data to display tag..
 
rodgers tang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ann,

Following is some code:

jsp page:
<display:table name="requestScope.rowSet.rows" id="testit"
requestURI="SubmitFISReportForm.do" sort="list" pagesize="12" defaultsort="3" align="center" width="945" decorator="rain.TableLink" >
<display:column sortable="true" property="server" title="Server" headerClass="sortable" />
<display:column sortable="true" property="outage_type" title="Outage Type" headerClass="sortable" /> // outage_type is database col name.
<display:column sortable="true" property="outage_start" title="Outage start" />
</display:table>

TableLink java Code:
public class TableLink extends TableDecorator {

/** Creates a new instance of TableLink */
public TableLink() {
super();
}
RowSetDynaClass obj=null;
public String getOutage_type(){

UserDAOBean map1 = (UserDAOBean)getCurrentRowObject();
String aa=map1.getOutageType();

return "<a href=\"tableLinks.jsp?id= "+ aa + "&action=view\" /a>";
}

}

Action form code:
public class SubmitFISReportFormAction extends Action {

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {

try {
String outageType=(String)PropertyUtils.getSimpleProperty(form,"outageType"); //get form value
String serverName=(String)PropertyUtils.getSimpleProperty(form,"serverName");
String startDate=(String)PropertyUtils.getSimpleProperty(form,"startDate");
String endDate=(String)PropertyUtils.getSimpleProperty(form,"endDate");

UserDAOBean bean = new UserDAOBean(serverName,outageType,startDate,endDate);
RowSetDynaClass rowSet= bean.getUsersRowSet();
request.setAttribute("rowSet", rowSet);
}
catch(Exception ex) {

}

return mapping.findForward("success");
}
}

If I do not use decorator, outputing table is fine.

Thanks for help.

H tang
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic