wood burning stoves 2.0*
The moose likes Struts and the fly likes displaytag decorator problem in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "displaytag decorator problem in struts" Watch "displaytag decorator problem in struts" New topic
Author

displaytag decorator problem in struts

rodgers tang
Greenhorn

Joined: Mar 11, 2005
Posts: 7
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

Joined: Sep 09, 2005
Posts: 27
Please forward the <display:table> code,getLink() code and the action from you get the data to display tag..
rodgers tang
Greenhorn

Joined: Mar 11, 2005
Posts: 7
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: displaytag decorator problem in struts
 
Similar Threads
hibernate subqueries
displayTag with checkBox/ BomoBox - looking for a tutrial or a concept
Pagination for Images
Struts : display tag : column decorator
netui and displaytag with paging problems