Ich möchte alle vorhandenen Dokuemnte in der JSP über jstl anzeigen. Dazu habe ich meine DocumentForm in der JSP bekannt gemacht.
In der struts-config.xml habe ich auch die Liste als Attribut angegeben:
struts-config.xml**************************************** *****************************
<form-bean name="dynaDocumentForm"
dynamic="true"
type="de.sourcepark.documentManagement.view.form.D ocumentForm">
<form-property name="allFiles" type="java.util.List"/>
</form-bean>
jsp:********************************************** ******
<jsp:useBean id="dynaDocumentForm" type="de.sourcepark.documentManagement.view.form.D ocumentForm" scope="session"/>
<c:forEach var="files" items="${allFiles}" >
<cut value="${files}" />
</c:forEach
action******************************************** ***************
In der DocumentAction habe ich die Liste mit den Dokumenten ganz normal
in die Form gespeichert, die <c:forEach> -Schleife wird aber trotzdem nicht durchlaufen, obwohl da aufjedenfall ein Element drin ist, mit <bean:write geht es ja, wenn ich die Liste in die Session speicher geht es auch. Das will ich aber nicht, weil ich die Liste ja über die Form ansprechen will, was kann ich tun?:
public ActionForward viewAllDocuments( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response )
throws Exception{
System.out.println("In DocumentAction: viewAllDocuments");
String path = (String) request.getParameter("path");
System.out.println("Path: "+path);
List allDocuments = ((IDocumentService) getBusinessDelegate(IConstants.DOCUMENT_SERVICE)). getAllDocuments(path);
System.out.println("AllDokumente size: "+allDocuments.size());
((DynaActionForm)form).set("allFiles", allDocuments);
return (mapping.findForward(IConstants.SUCCESS));
}
************************************************** *********
Danke für die Hife:-)
Nici
In der struts-config.xml habe ich auch die Liste als Attribut angegeben:
struts-config.xml**************************************** *****************************
<form-bean name="dynaDocumentForm"
dynamic="true"
type="de.sourcepark.documentManagement.view.form.D ocumentForm">
<form-property name="allFiles" type="java.util.List"/>
</form-bean>
jsp:********************************************** ******
<jsp:useBean id="dynaDocumentForm" type="de.sourcepark.documentManagement.view.form.D ocumentForm" scope="session"/>
<c:forEach var="files" items="${allFiles}" >
<cut value="${files}" />
</c:forEach
action******************************************** ***************
In der DocumentAction habe ich die Liste mit den Dokumenten ganz normal
in die Form gespeichert, die <c:forEach> -Schleife wird aber trotzdem nicht durchlaufen, obwohl da aufjedenfall ein Element drin ist, mit <bean:write geht es ja, wenn ich die Liste in die Session speicher geht es auch. Das will ich aber nicht, weil ich die Liste ja über die Form ansprechen will, was kann ich tun?:
public ActionForward viewAllDocuments( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response )
throws Exception{
System.out.println("In DocumentAction: viewAllDocuments");
String path = (String) request.getParameter("path");
System.out.println("Path: "+path);
List allDocuments = ((IDocumentService) getBusinessDelegate(IConstants.DOCUMENT_SERVICE)). getAllDocuments(path);
System.out.println("AllDokumente size: "+allDocuments.size());
((DynaActionForm)form).set("allFiles", allDocuments);
return (mapping.findForward(IConstants.SUCCESS));
}
************************************************** *********
Danke für die Hife:-)
Nici
Comment