Struts + Table

Status
Nicht offen für weitere Antworten.

di3u

Mitglied
Hallo,

bietet mir Struts die Möglichkeit Tabellen über ein entsprechendes Tag darzustellen, die dann bereits Zeilenauswahl, Blättern, etc. beinhaltet?

Dass ich über eine Collection mittels <logic:iterate> laufen kann und die in eine Tabelle schriebe ist mir dabei klar, aber was ich brauche wäre eben zusätzlich ein Radiobutton vor der Zeile und ggf. eine Blätteroption.

Ich bin eben über die Libary struts-layout.tld gestoßen, habe aber noch nichts passendes gefunden. Vielleicht weiß hier ja jemand mehr?!

Danke im Voraus.
 
G

Guest

Gast
Danke für den Hinweis, aber kann mir mal jemand erklären, wie ich das tag in meine JSP-Seite einbaue, bzw. was ich so alles brauche?

Unter Distribution gibts nur ganze Web-Projekte zum Download und diese Intallation notes helfen mir irgendwie auch nicht wirklich weiter?!?
 
G

Guest

Gast
Ich bin eben noch über diese Tag-Library gestoßen: Display Tag

Aber auch hier habe ich das Problem, dass ich diese nicht in mein Projekt eingebunden bekomme. Wenn mir hierzu vielleicht jemand weiterhelfen könnte?!

Danke im Voraus!
 

DreamArtist

Bekanntes Mitglied
Hallo, die Einbindung findest du unter

http://displaytag.sourceforge.net/11/install.html

Also zu beginn deiner JSP:

Code:
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

ansprechen kannst Du sie in der jsp dann mittels

Code:
<display:table name="test">
  <display:column property="id" title="ID" />
  <display:column property="name" />
  <display:column property="email" />
  <display:column property="status" />
  <display:column property="description" title="Comments"/>
</display:table>


Solltest du Maven verwenden:

Code:
<dependency>
      <groupId>displaytag</groupId>
      <artifactId>displaytag</artifactId>
      <version>1.1</version>
    </dependency>

ansonst musst du dir die lib unter download http://displaytag.sourceforge.net/11/download.html
runterladen und in deinen Classpath einfügen.

lg DreamArtist
 
G

Guest

Gast
Ich bin jetzt mal hergegangen und habe in meiner Action eine Collection mit Beans in die Session geschrieben:
Code:
request.setAttribute("test",userList);

In der JSP versuche ich erst mal den einfachsten aller Darstellungswege:
Code:
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

(...)

<display:table name="test"/>


Das Ergebnis:
Code:
[ServletException in:/jsp/admin/showUserList.jsp] org/apache/commons/lang/UnhandledException' 
java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException at 
java.lang.Class.getDeclaredConstructors0(Native Method) at 
java.lang.Class.privateGetDeclaredConstructors(Class.java:2328) at 
java.lang.Class.getConstructor0(Class.java:2640) at java.lang.Class.newInstance0(Class.java:321) at 
java.lang.Class.newInstance(Class.java:303) at java.beans.Introspector.instantiate(Introspector.java:1432) at 
java.beans.Introspector.findExplicitBeanInfo(Introspector.java:410) at 
java.beans.Introspector.(Introspector.java:359) at java.beans.Introspector.getBeanInfo(Introspector.java:159) at 
org.apache.jasper.compiler.Generator$TagHandlerInfo.(Generator.java:3712) at 
org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2120) at 
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1599) at 
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) at 
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at 
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at 
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1705) at 
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) at 
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at 
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at 
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219) at 
org.apache.jasper.compiler.Node$Root.accept(Node.java:456) at 
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at 
org.apache.jasper.compiler.Generator.generate(Generator.java:3304) at 
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198) at 
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295) at 
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276) at 
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264) at 
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563) at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303) at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574) at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499) at 
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:822) at 
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:398) at 
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137) at 
org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177) at 
org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756) at 
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881) at 
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473) at 
org.apache.jsp.jsp.layout.layout_jsp._jspx_meth_tiles_insert_4(org.apache.jsp.jsp.layout.layout_jsp:461) at 
org.apache.jsp.jsp.layout.layout_jsp._jspx_meth_html_html_0(org.apache.jsp.jsp.layout.layout_jsp:244) at 
org.apache.jsp.jsp.layout.layout_jsp._jspService(org.apache.jsp.jsp.layout.layout_jsp:77) at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463) at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398) at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) at 

(...)


Außerdem habe ich noch in meinem lib-Verzeichnis dispaytag-1.1.jar und displaytag-export-poi-1.1.jar liegen (wobei ich nicht glaube, dass ich letzteres überhaupt brauchen werde). Arbeiten tue ich mit Struts 1.2 und Tomcat 5.15.

Wenn mir also jemand weiterhelfen könnte wäre das super!!
 
G

Guest

Gast
DreamArtist hat gesagt.:
ansonst musst du dir die lib unter download http://displaytag.sourceforge.net/11/download.html
runterladen und in deinen Classpath einfügen.

lg DreamArtist


Also wenn ich lediglich in der JSP die taglib einbinde bekomme ich kein Tag "layout" angezeigt :(
Ich habe jetzt auch schon mal versucht displaytag-1.1.jar, displaytag-portlet-1.1.jar und display-export-pi-1.1.jar in bein lib-Verz. einzubinden, bringt aber auch nichts...

Was mach ich falsch?
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
S Struts 2 datetimepicker Allgemeines EE 3
W Struts Tutorial für EE Noobs? Allgemeines EE 2
N Struts vs JSF ? Allgemeines EE 7
W Speicher-Problem bei WebApp unter Tomcat, Struts, Hibernate Allgemeines EE 3
Lex Property per html:link schreiben in struts Allgemeines EE 2
Shihan Line Breaks in <br /> umwandeln (Struts) Allgemeines EE 7
S Struts: zwei JSP's nutzen eine Action Allgemeines EE 5
G Struts: ActionMessage value in JSP anzeigen Allgemeines EE 2
S Problem mit Struts und tiles Allgemeines EE 4
S Struts und Session Allgemeines EE 2
K Struts - FormBean mit 2 Listen - Anzeigen und Speichern Allgemeines EE 2
S Probleme mit struts - ActionServlet Allgemeines EE 6
C Struts in iFrame Allgemeines EE 2
Z Struts: Formularfelder initialisieren Allgemeines EE 3
S Struts: Wert in einem iterierten Drop-Down Menü selektieren Allgemeines EE 7
T Struts 2 Allgemeines EE 6
R Struts-Action in JSP abfragen? Allgemeines EE 2
J struts: Bild als submit-button Allgemeines EE 2
J Internationalization mit Struts Allgemeines EE 2
E bei struts inhalte über mehrere seite verteilen Allgemeines EE 6
velaluka Struts- falsches Character-Encoding? Allgemeines EE 3
M URL Darstl. und Struts Allgemeines EE 2
G Struts beans Allgemeines EE 7
L Struts - Action auslösen bei Browser Back Allgemeines EE 2
N Struts - Problem mit <html:link> Action Allgemeines EE 3
netspy Struts, Spring oder ... ? Allgemeines EE 5
S Struts - Direktaufruf eines URL verhindern Allgemeines EE 11
1 Frage zu Struts und findForward Allgemeines EE 4
N Struts Jboss und Filter Allgemeines EE 2
S Fragen zu: Servlets, Struts & Hibernate Allgemeines EE 9
T Struts und Objekte in Comboboxen Allgemeines EE 4
J Probleme mit Struts Allgemeines EE 3
K STRUTS The server encountered an internal error Allgemeines EE 5
F struts logic:iterate Allgemeines EE 5
M STRUTS/Cannot retrieve definition for form bean null on acti Allgemeines EE 4
G struts-config.xml Allgemeines EE 3
H Ich bin sehr verwirrt - struts, jsp, jsf . ? Allgemeines EE 53
P Testen von Struts-Anwendung Allgemeines EE 7
P Struts Form Bean vs. Session Variable Allgemeines EE 6
A Tomcat undeploy unter Windows klappt nicht wegen struts.jar Allgemeines EE 2
B Struts Problem: Array in JSP ausgeben (logic:iterate) Allgemeines EE 12
M Struts Deployment Allgemeines EE 3
R Mehrsprachige Seite mit Struts & Co. ? Allgemeines EE 5
S mehrere Message Resources in Struts ansprechen Allgemeines EE 7
G Values aus DB in Input-Feldern anzeigen (Struts) Allgemeines EE 2
G Exception creating bean of class . (Struts) Allgemeines EE 8
B Verwendung von DynActionForm (Struts) Allgemeines EE 10
K dynamischer Zugriff auf .properties (Struts) Allgemeines EE 2
K Struts html:messages tag Allgemeines EE 2
M Struts File Upload problem Allgemeines EE 6
G Validierung mittels Struts. Benötige Hilfe. Allgemeines EE 7
J Buchempfehlung: Servlets, JSP, Struts, JSTL Allgemeines EE 3
P struts "beliebige motive in der datenbank finden" Allgemeines EE 6
P Struts und Frames Allgemeines EE 13
L jfreechart und Struts / JSPs Allgemeines EE 3
P struts Hibernate MySQL Select Statement Allgemeines EE 24
P keine verbindung vom struts framework zu mysql Allgemeines EE 2
R Vernünftige Session-Verwaltung mit Struts Allgemeines EE 4
P Struts Anwendung- FormBean Tabelle mit input type=text Allgemeines EE 2
G Probleme mit Validierung (Struts, validation.xml) Allgemeines EE 4
M Struts - ActionForward Allgemeines EE 9
clemson gesplittete struts-config mittels ant zusammenbauen Allgemeines EE 2
J Struts Textfeld Allgemeines EE 10
M Struts shale Allgemeines EE 7
M Struts - jsp site - werte formatieren Allgemeines EE 6
clemson mehrere Mail Attachments - JSP Struts Allgemeines EE 7
T JSTL + Struts (inkl.Hibernate) -> forEach Problem Allgemeines EE 6
R Struts FormBean Allgemeines EE 4
S Struts 1.1 download einer Datei Allgemeines EE 4
R Use bean in scriptlet in struts Allgemeines EE 4
S reagieren auf select events in jsp-struts seiten Allgemeines EE 5
P Struts - Text formatieren Allgemeines EE 6
C Grafische Komponenten unter Struts jsp (Liste) Allgemeines EE 4
P Struts - Abarbeitung Allgemeines EE 3
P J2EE Struts - Database connection failed - Hilfe?:( Allgemeines EE 6
P J2EE Struts Allgemeines EE 2
R struts 1.0.2 Checkbox-Property bleibt immer false Allgemeines EE 3
TRunKX Werteübergabe von einer *.jsp in eine *.java ohne struts Allgemeines EE 4
clemson [Struts] Validierung server-seitig bringt StackOverflowError Allgemeines EE 5
clemson [Struts] HTML-Checkbox Tag ID Allgemeines EE 2
clemson [Struts] Einer Action Parameter übergeben Allgemeines EE 2
clemson [Struts] Innerhalb Action auf form zugreifen Allgemeines EE 4
G In einer JSP auf Struts-Elemente "reagieren" Allgemeines EE 4
clemson [Struts] struts-config.xml parsen Allgemeines EE 2
clemson [Struts] Parameter an ActionForward anhängen Allgemeines EE 3
clemson [Struts] TilesRequestProcessor - processRoles Allgemeines EE 14
F Struts Allgemeines EE 9
G Struts-Write Anweisungen in Hyperlink einbauen Allgemeines EE 3
G Struts-Form: in validate- oder reset-Methode umleiten. Allgemeines EE 3
G Listenfeld mit Struts und Beans realisieren Allgemeines EE 4
L Anfänger: suche Tutorials zu Struts/EJB Allgemeines EE 6
G Struts - dynamisches FormBean Allgemeines EE 3
R struts und Mapped Properties Allgemeines EE 2
A Javadocs zu struts Allgemeines EE 5
A Kolloquium J2EE / Struts Allgemeines EE 16
A Expression Language in Struts? Allgemeines EE 6
A Form Validierung mit Struts? Allgemeines EE 2
A struts: html:form-tag das Attribut "name" ersetzen Allgemeines EE 7
B struts - beginnerproblem Allgemeines EE 3
B Struts DBCP Allgemeines EE 4

Ähnliche Java Themen

Neue Themen


Oben