ERLEDIGT
NEIN
NEIN
ANTWORTEN
3
3
ZUGRIFFE
4558
4558
EMPFEHLEN
-
Guten abend,
ich habe folgendes Problem, un zwar beim Zugriff auf Properties aus einem Set wird eine Exception geworfen.
Ein geküztes Programm-Code möchte ich hier unten vorstellen.
Erste Klasse : Patient
Die zweite Klasse : FeedbackCode :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
[COLOR=black][FONT="]// Generated 20.12.2006 [/FONT][/COLOR][COLOR=black][FONT="]20:30:40[/FONT][/COLOR][COLOR=black][FONT="] by Hibernate Tools 3.1.0.beta5[/FONT][/COLOR] [COLOR=black][FONT="]//imports …[/FONT][/COLOR] [COLOR=black][FONT="]/**[/FONT][/COLOR] [COLOR=black][FONT="] * Patient generated by hbm2java[/FONT][/COLOR] [COLOR=black][FONT="] */[/FONT][/COLOR] [COLOR=black][FONT="][B]public class [/B]Patient implements java.io.Serializable {[/FONT][/COLOR] [COLOR=black][FONT="] // Fields [/FONT][/COLOR] [COLOR=black][FONT="] [B]private int [/B]patientId;[/FONT][/COLOR] [COLOR=black][FONT="] [B]private[/B] [B]Set[/B]<Feedback> feedbacks = new [/FONT][/COLOR][COLOR=black][FONT="] [/FONT][/COLOR] [COLOR=black][FONT="] [B]HashSet[/B][/FONT][/COLOR][COLOR=black][FONT="]<Feedback>(0);[/FONT][/COLOR] [COLOR=black][FONT="] [B]private Set[/B]<Chemotest> chemotests = new [/FONT][/COLOR] [COLOR=black][FONT="] [B]HashSet[/B]<Chemotest>(0);[/FONT][/COLOR] [COLOR=black][FONT="] // Constructors[/FONT][/COLOR] [COLOR=black][FONT="] /** default constructor */[/FONT][/COLOR] [COLOR=black][FONT="] [B]public[/B] Patient() {[/FONT][/COLOR] [COLOR=black][FONT="]}[/FONT][/COLOR] [COLOR=black][FONT="]// Property accessors[/FONT][/COLOR] [COLOR=black][FONT="] [B]public int[/B] getPatientId() {[/FONT][/COLOR] [COLOR=black][FONT="] [B]return[/B] this.patientId;[/FONT][/COLOR] [COLOR=black][FONT="] }[/FONT][/COLOR] [COLOR=black][FONT="] ... [/FONT][/COLOR] [COLOR=black][FONT="] [B]public Set[/B]<Feedback> getFeedbacks() {[/FONT][/COLOR] [COLOR=black][FONT="] [B]return[/B] this.feedbacks;[/FONT][/COLOR] [COLOR=black][FONT="] }[/FONT][/COLOR] [COLOR=black][FONT="] [B]public void[/B] setFeedbacks(Set<Feedback> feedbacks) {[/FONT][/COLOR] [COLOR=black][FONT="] this.feedbacks = feedbacks;[/FONT][/COLOR] [COLOR=black][FONT="] }[/FONT][/COLOR] [COLOR=black][FONT="] [B]public Set[/B]<Chemotest> getChemotests() {[/FONT][/COLOR] [COLOR=black][FONT="] return this.chemotests;[/FONT][/COLOR] [COLOR=black][FONT="] }[/FONT][/COLOR] [COLOR=black][FONT="] [B]public void [/B]setChemotests(Set<Chemotest> chemotests) {[/FONT][/COLOR] [COLOR=black][FONT="]this.chemotests = chemotests;[/FONT][/COLOR] [COLOR=black][FONT="] }[/FONT][/COLOR] [COLOR=black][FONT="]}[/FONT][/COLOR]
Meine Klassen sind wie folgt gemappt:Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
[B][COLOR=black][FONT="]public[/FONT][/COLOR][/B][COLOR=black][FONT="] [B]class[/B] Feedback [B]implements[/B] java.io.Serializable {[/FONT][/COLOR] [COLOR=black][FONT="]// Fields [/FONT][/COLOR] [COLOR=black][FONT="] [B]private[/B] [B]int[/B] feedbackId;[/FONT][/COLOR] [COLOR=black][FONT="] [B]private[/B] Patient patient;[/FONT][/COLOR] [B][COLOR=black][FONT="]private[/FONT][/COLOR][/B][COLOR=black][FONT="] String feedbackText;[/FONT][/COLOR] [COLOR=black][FONT="] [B]private[/B] [B]byte[/B] type;[/FONT][/COLOR] [COLOR=black][FONT="] [B]private[/B] Date date;[/FONT][/COLOR] [COLOR=black][FONT="] // Constructors[/FONT][/COLOR] [COLOR=black][FONT="] /** default constructor */[/FONT][/COLOR] [COLOR=black][FONT="] [B]public[/B] Feedback() {[/FONT][/COLOR] [COLOR=black][FONT="] }[/FONT][/COLOR] [COLOR=black][FONT="] // Property accessors[/FONT][/COLOR] [COLOR=black][FONT="] [B]public[/B] [B]int[/B] getFeedbackId() {[/FONT][/COLOR] [COLOR=black][FONT="] [B]return[/B] [B]this[/B].feedbackId;[/FONT][/COLOR] [COLOR=black][FONT="] }[/FONT][/COLOR] [COLOR=black][FONT="] …[/FONT][/COLOR] [COLOR=black][FONT="]}[/FONT][/COLOR]
1.Klasse Patient
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
[COLOR=black][FONT="]<?xml version="1.0"?>[/FONT][/COLOR] [COLOR=black][FONT="]<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"[/FONT][/COLOR] [COLOR=black][FONT="]"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">[/FONT][/COLOR] [COLOR=black][FONT="]<!-- Generated 20.12.2006 [/FONT][/COLOR][COLOR=black][FONT="]20:30:41[/FONT][/COLOR][COLOR=black][FONT="] by Hibernate Tools 3.1.0.beta5 -->[/FONT][/COLOR] [COLOR=black][FONT="]<hibernate-mapping>[/FONT][/COLOR] [COLOR=black][FONT="] <class name="ipis.domain.Patient" table="patient" catalog="ipis">[/FONT][/COLOR] [COLOR=black][FONT="]<comment></comment>[/FONT][/COLOR] [COLOR=black][FONT="] <id name="patientId" type="int">[/FONT][/COLOR] [COLOR=black][FONT="] <column name="patient_id" />[/FONT][/COLOR] [COLOR=black][FONT="] <generator class="assigned" />[/FONT][/COLOR] [COLOR=black][FONT="]</id>[/FONT][/COLOR] [COLOR=black][FONT="] <set name="feedbacks" [/FONT][/COLOR][COLOR=black][FONT="]inverse="true"[/FONT][/COLOR][COLOR=black][FONT="]>[/FONT][/COLOR] [COLOR=black][FONT="] <key>[/FONT][/COLOR] [COLOR=black][FONT="] <column name="patient_id" not-null="true">[/FONT][/COLOR] [COLOR=black][FONT="] <comment></comment>[/FONT][/COLOR] [COLOR=black][FONT="] </column>[/FONT][/COLOR] [COLOR=black][FONT="] </key>[/FONT][/COLOR] [COLOR=black][FONT="] <one-to-many class="ipis.domain.Feedback" />[/FONT][/COLOR] [COLOR=black][FONT="] </set>[/FONT][/COLOR] [COLOR=black][FONT="] <set name="chemotests" inverse="true">[/FONT][/COLOR] [COLOR=black][FONT="] <key>[/FONT][/COLOR] [COLOR=black][FONT="] <column name="patient_id" not-null="true">[/FONT][/COLOR] [COLOR=black][FONT="] <comment></comment>[/FONT][/COLOR] [COLOR=black][FONT="] </column>[/FONT][/COLOR] [COLOR=black][FONT="] </key>[/FONT][/COLOR] [COLOR=black][FONT="] <one-to-many class="ipis.domain.Chemotest" />[/FONT][/COLOR] [COLOR=black][FONT="] </set>[/FONT][/COLOR] [COLOR=black][FONT="] </class>[/FONT][/COLOR] [COLOR=black][FONT="]</hibernate-mapping>[/FONT][/COLOR]
2.Klasse Feedback
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
[COLOR=black][FONT="]<?xml version="1.0"?>[/FONT][/COLOR] [COLOR=black][FONT="]<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"[/FONT][/COLOR] [COLOR=black][FONT="]"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">[/FONT][/COLOR] [COLOR=black][FONT="]<!-- Generated 20.12.2006 [/FONT][/COLOR][COLOR=black][FONT="]20:30:41[/FONT][/COLOR][COLOR=black][FONT="] by Hibernate Tools 3.1.0.beta5 -->[/FONT][/COLOR] [COLOR=black][FONT="]<hibernate-mapping>[/FONT][/COLOR] [COLOR=black][FONT="] <class name="ipis.domain.Feedback" table="feedback" catalog="ipis">[/FONT][/COLOR] [COLOR=black][FONT="] <comment></comment>[/FONT][/COLOR] [COLOR=black][FONT="] <id name="feedbackId" type="int">[/FONT][/COLOR] [COLOR=black][FONT="] <column name="feedback_id" />[/FONT][/COLOR] [COLOR=black][FONT="] <generator class="increment" />[/FONT][/COLOR] [COLOR=black][FONT="] </id>[/FONT][/COLOR] [COLOR=black][FONT="] <many-to-one name="patient" class="ipis.domain.Patient" fetch="select">[/FONT][/COLOR] [COLOR=black][FONT="] <column name="patient_id" not-null="true">[/FONT][/COLOR] [COLOR=black][FONT="] <comment></comment>[/FONT][/COLOR] [COLOR=black][FONT="] </column>[/FONT][/COLOR] [COLOR=black][FONT="] </many-to-one>[/FONT][/COLOR] [COLOR=black][FONT="] <property name="feedbackText" type="string">[/FONT][/COLOR] [COLOR=black][FONT="] <column name="feedback_text" length="65535" not-null="true">[/FONT][/COLOR] [COLOR=black][FONT="] <comment></comment>[/FONT][/COLOR] [COLOR=black][FONT="] </column>[/FONT][/COLOR] [COLOR=black][FONT="] </property>[/FONT][/COLOR] [COLOR=black][FONT="] </class>[/FONT][/COLOR] [COLOR=black][FONT="]</hibernate-mapping>[/FONT][/COLOR]
In der Frontend-Schicht möchte ich die Daten über den Patienten und seine Feedbacks anzeigen, meine JSF-Seite sieht so aus:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
[COLOR=black][FONT="]<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>[/FONT][/COLOR] [COLOR=black][FONT="]<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>[/FONT][/COLOR] [COLOR=black][FONT="]<html>[/FONT][/COLOR] [COLOR=black][FONT="]<%@ include file="../base/includeHeader.jsp" %>[/FONT][/COLOR] [COLOR=black][FONT="]<body>[/FONT][/COLOR] [COLOR=black][FONT="]<f:view>[/FONT][/COLOR] [COLOR=black][FONT="]<%@ include file="top.jsp"%>[/FONT][/COLOR] [COLOR=black][FONT="] <h2>My data</h2>[/FONT][/COLOR] [COLOR=black][FONT="] <h:form id="form">[/FONT][/COLOR] [COLOR=black][FONT="] <table>[/FONT][/COLOR] [COLOR=black][FONT="] <h:dataTable value="#{patientAction.currentPatient}" var="patient"[/FONT][/COLOR] [COLOR=black][FONT="] border="1" >[/FONT][/COLOR] [COLOR=black][FONT="] <h:column>[/FONT][/COLOR] [COLOR=black][FONT="] <h:outputText value="Identifier" />[/FONT][/COLOR] [COLOR=black][FONT="] </h:column>[/FONT][/COLOR] [COLOR=black][FONT="] <h:column>[/FONT][/COLOR] [COLOR=black][FONT="] <h:outputText value="#{patient.patientId}" />[/FONT][/COLOR] [COLOR=black][FONT="] </h:column>[/FONT][/COLOR] [COLOR=black][FONT="] <h:column>[/FONT][/COLOR] [COLOR=black][FONT="] <h:dataTable value="#{patient.feedbacks}" var="feedbacks"[/FONT][/COLOR] [COLOR=black][FONT="] border="1">[/FONT][/COLOR] [COLOR=black][FONT="] <h:column>[/FONT][/COLOR] [COLOR=black][FONT="] [B][COLOR=Red]<h:outputText value="#{feedbacks.type}" />[/COLOR][/B][/FONT][/COLOR] [COLOR=black][FONT="] </h:column>[/FONT][/COLOR] [COLOR=black][FONT="] </h:dataTable>[/FONT][/COLOR] [COLOR=black][FONT="] </h:column>[/FONT][/COLOR] [COLOR=black][FONT="] </h:dataTable>[/FONT][/COLOR] [COLOR=black][FONT="]</table>[/FONT][/COLOR] [COLOR=black][FONT="]</h:form>[/FONT][/COLOR] [COLOR=black][FONT="]</f:view>[/FONT][/COLOR] [COLOR=black][FONT="]</body>[/FONT][/COLOR] [COLOR=black][FONT="]</html>[/FONT][/COLOR]
Schön wäre es wenn es so funktionieren würde, leider wird folgendes Exception geworfen:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
[COLOR=black] [/COLOR] [COLOR=black][FONT="]2007-01-22 15:26:02,317 ERROR [org.apache.myfaces.shared_impl.renderkit.RendererUtils] - Property not found - called by component : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /ipis-jsp/mydata.jsp][Class: javax.faces.component.html.HtmlForm,Id: form][Class: javax.faces.component.html.HtmlDataTable,Id: _idJsp5][Class: javax.faces.component.UIColumn,Id: _idJsp10][Class: javax.faces.component.html.HtmlDataTable,Id: _idJsp11][Class: javax.faces.component.UIColumn,Id: _idJsp12][Class: javax.faces.component.html.HtmlOutputText,Id: _idJsp13]}[/FONT][/COLOR] [B][U][COLOR=black][FONT="]javax.faces.el.PropertyNotFoundException[/FONT][/COLOR][/U][COLOR=black][FONT="]: Bean: org.hibernate.collection.PersistentSet, property: type[/FONT][/COLOR] [/B][COLOR=black][FONT="][B] at[/B] org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor([U]PropertyResolverImpl.java:483[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor([U]PropertyResolverImpl.java:454[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.el.PropertyResolverImpl.getProperty([U]PropertyResolverImpl.java:417[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.el.PropertyResolverImpl.getValue([U]PropertyResolverImpl.java:82[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate([U]ELParserHelper.java:532[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.commons.el.ComplexValue.evaluate([U]ComplexValue.java:145[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.el.ValueBindingImpl.getValue([U]ValueBindingImpl.java:383[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at javax.faces.component.UIOutput.getValue([U]UIOutput.java:77[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue([U]RendererUtils.java:217[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput([U]HtmlTextRendererBase.java:69[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd([U]HtmlTextRendererBase.java:57[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at javax.faces.component.UIComponentBase.encodeEnd([U]UIComponentBase.java:536[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild([U]RendererUtils.java:442[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren([U]RendererUtils.java:419[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild([U]RendererUtils.java:440[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.renderColumnBody([U]HtmlTableRendererBase.java:212[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeColumnChild([U]HtmlTableRendererBase.java:181[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeInnerHtml([U]HtmlTableRendererBase.java:167[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeChildren([U]HtmlTableRendererBase.java:100[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at javax.faces.component.UIComponentBase.encodeChildren([U]UIComponentBase.java:524[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild([U]RendererUtils.java:436[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren([U]RendererUtils.java:419[/U])[/FONT][/COLOR] [COLOR=black][FONT="] at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild([U]RendererUtils.java:440[/U])[/FONT][/COLOR] [COLOR=black][FONT="]…[/FONT][/COLOR] [COLOR=black][FONT="]…[/FONT][/COLOR] [COLOR=black][FONT="]…[/FONT][/COLOR] [COLOR=black] [/COLOR]
Ich bin Absolut neu in JSF und JSP, ich weiss nicht wie ich dieses Problem überwende.
Vielleicht muss ich hier List statt Set benutzen, stimmt mir jemand zu? Wenn ja wie geht's das?
Ich würde mich sehr freune über eine Antwort.
Danke im Voraus.
-
22.01.07 21:13 #2
- Registriert seit
- Jun 2002
- Ort
- Saarbrücken (Saarland)
- Beiträge
- 9.886
- Blog-Einträge
- 29
Hallo!
Im Hibernate Mapping für Feedback fehelen die Properties für:
Code :1 2 3
private byte type; private Date date;
Weiterhin brauchst du dafür auch entsprechende (public) getter / setter Methoden in der Klasse Feedback, dann sollte es klappen.
Gruß TomJava rocks!
How to become a good Java Programmer?
Does IT in Java and .Net
The only valid measurement of code quality: WTFs / minute
Blog
Xing
Twitter
-
Hallo Tom,
vielen dank für deine Antwort!
Es tut mir Leid ich wollte ein bißschen kürzen und habe ein paar Zeilen gelöscht
Hier ist der vollständige Code
Das hibernate mapping:
und die Feedback-KlasseCode :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<hibernate-mapping> <class name="ipis.domain.Feedback" table="feedback" catalog="ipis"> <comment></comment> <id name="feedbackId" type="int"> <column name="feedback_id" /> <generator class="increment" /> </id> <many-to-one name="patient" class="ipis.domain.Patient" fetch="select"> <column name="patient_id" not-null="true"> <comment></comment> </column> </many-to-one> <property name="feedbackText" type="string"> <column name="feedback_text" length="65535" not-null="true"> <comment></comment> </column> </property> <property name="type" type="byte"> <column name="type" not-null="true"> <comment></comment> </column> </property> <property name="date" type="timestamp"> <column name="date" length="19" not-null="true"> <comment></comment> </column> </property> </class> </hibernate-mapping>
Muss ich irgendwo irgenwelche Konifurationen machen?Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
package ipis.domain; // Generated 20.12.2006 20:30:40 by Hibernate Tools 3.1.0.beta5 import java.util.Date; /** * Feedback generated by hbm2java */ public class Feedback implements java.io.Serializable { // Fields private int feedbackId; private Patient patient; private String feedbackText; private byte type; private Date date; // Constructors /** default constructor */ public Feedback() { } /** full constructor */ public Feedback(int feedbackId, Patient patient, String feedbackText, byte type, Date date) { this.feedbackId = feedbackId; this.patient = patient; this.feedbackText = feedbackText; this.type = type; this.date = date; } // Property accessors public int getFeedbackId() { return this.feedbackId; } public void setFeedbackId(int feedbackId) { this.feedbackId = feedbackId; } public Patient getPatient() { return this.patient; } public void setPatient(Patient patient) { this.patient = patient; } public String getFeedbackText() { return this.feedbackText; } public void setFeedbackText(String feedbackText) { this.feedbackText = feedbackText; } public byte getType() { return this.type; } public void setType(byte type) { this.type = type; } public Date getDate() { return this.date; } public void setDate(Date date) { this.date = date; } }
Ich habe eine Datei : ApplictionContextJSF.xml die spring-Bean.Definitionen enthält, und wird in Faces-config.xml geladen:
Ich weiss nicht warum die Properties von Feedback nicht erkannt werden, HILFECode :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" default-autowire="byType"> <!-- Für die Fehlermeldungen und Meldungen --> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <list> <value>errors</value> <value>ipis.auth.messages</value> </list> </property> </bean> <bean id="feedbackAction" class="ipis.web.jsf.FeedbackAction"> <property name="feedbackServiceI" ref="feedbackServiceI" /> <property name="feedbackDaoI" ref="feedbackDaoI" /> <property name="patientAuthService" ref="patientAuthService" /> </bean> <bean name="patientAuthService" class="ipis.auth.PatientAuthServiceImpl"> <property name="authenticationManager" ref="authenticationManager" /> <property name="patientDaoI" ref="patientDaoI" /> </bean> <bean id="patientAction" class="ipis.web.jsf.PatientAction"> <property name="patientServiceI" ref="patientServiceI" /> <property name="patientAuthService" ref="patientAuthService" /> <property name="patientDaoI" ref="patientDaoI" /> <property name="messageSource" ref="messageSource" /> </bean> <!-- session scope --> <bean name="feedback" class="ipis.domain.Feedback" scope="session"> </bean> <!-- request scope --> <bean name="patient" class="ipis.domain.Patient" scope="request"> </bean> </beans>

Brauche ich irgenwie ein converter?
Gruß Hind
-
Noch eine Frage :
Ich habe in der Datenbank für das Attribut "gender" , eine 0 oder 1 gespeichert, wenn es eine 1 ist, dann heißt es, dass gender Männlich ist , und wenn 0 dann heißt es, dass gender Weiblich ist.
Ich möchte in der Ausgabe , statt 0 oder 1 , Männlich oder Weiblich ausgeben.
Mein Code sieht so aus:
Das in Blau markierte code war einer der Versuche. Bitte wenn jemand weiss wie es geht, bitte meldet euch.Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
[COLOR=black][FONT="]<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>[/FONT][/COLOR] [COLOR=black][FONT="]<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>[/FONT][/COLOR] [COLOR=black][FONT="]<html>[/FONT][/COLOR] [COLOR=black][FONT="]<%@ include file="../base/includeHeader.jsp" %>[/FONT][/COLOR] [COLOR=black][FONT="]<body>[/FONT][/COLOR] [COLOR=black][FONT="]<f:view>[/FONT][/COLOR] [COLOR=black][FONT="]<%@ include file="top.jsp"%>[/FONT][/COLOR] [COLOR=black][FONT="] <h2>My data</h2>[/FONT][/COLOR] [COLOR=black][FONT="] <h:form id="form">[/FONT][/COLOR] [COLOR=black][FONT="] <table>[/FONT][/COLOR] [COLOR=black][FONT="] <h:dataTable value="#{patientAction.currentPatient}" var="patient"[/FONT][/COLOR] [COLOR=black][FONT="] border="1" >[/FONT][/COLOR] [COLOR=black][FONT="] <h:column>[/FONT][/COLOR] [COLOR=black][FONT="] <h:outputText value="Identifier" />[/FONT][/COLOR] [COLOR=black][FONT="] </h:column>[/FONT][/COLOR] [COLOR=black][FONT="] <h:column>[/FONT][/COLOR] [COLOR=black][FONT="] <h:outputText value="#{patient.patientId}" />[/FONT][/COLOR] [COLOR=black][FONT="] </h:column> [/FONT][/COLOR] [COLOR=Blue]<h:column> <% if(%>${patient.gender}<%==1) %> <h:outputText value="Weiblich" /> </h:column> [/COLOR] [COLOR=black][FONT="] <h:column>[/FONT][/COLOR] [COLOR=black][FONT="] <h:dataTable value="#{patient.feedbacks}" var="feedbacks"[/FONT][/COLOR] [COLOR=black][FONT="] border="1"> [/FONT][/COLOR] [COLOR=black][FONT="] <h:column>[/FONT][/COLOR] [COLOR=black][FONT="] [COLOR=Black]<h:outputText value="#{feedbacks.type}" />[/COLOR][/FONT] [/COLOR][COLOR=black][FONT="] </h:column>[/FONT][/COLOR] [COLOR=black][FONT="] </h:dataTable>[/FONT][/COLOR] [COLOR=black][FONT="] </h:column> [/FONT][/COLOR] [COLOR=black][FONT="] </h:dataTable>[/FONT][/COLOR] [COLOR=black][FONT="]</table>[/FONT][/COLOR] [COLOR=black][FONT="]</h:form>[/FONT][/COLOR] [COLOR=black][FONT="]</f:view>[/FONT][/COLOR] [COLOR=black][FONT="]</body>[/FONT][/COLOR] [COLOR=black][FONT="]</html>[/FONT][/COLOR]
Ähnliche Themen
-
Hibernate Collection mergen
Von sebastianb im Forum JavaAntworten: 0Letzter Beitrag: 27.09.10, 12:59 -
Hibernate/JPA Collection
Von Peregrin im Forum JavaAntworten: 0Letzter Beitrag: 26.01.10, 10:41 -
Hibernate: illegal access to loading collection
Von Kryptaesthesie im Forum JavaAntworten: 4Letzter Beitrag: 29.12.09, 13:18 -
Hibernate: save, update, saveOrUpdate, merge, .... [an alle Hibernate-Profis]
Von DerGrinsemann im Forum JavaAntworten: 2Letzter Beitrag: 13.06.07, 09:24 -
Hibernate List Problem
Von e.motion im Forum JavaAntworten: 9Letzter Beitrag: 18.02.05, 15:40





Zitieren

Login





