ERLEDIGT
NEIN
NEIN
ANTWORTEN
1
1
ZUGRIFFE
315
315
EMPFEHLEN
-
Hallo,
folgendes Szenario:
Code :1 2 3 4 5
... <topic title="myTopic"> Hier kommt ne ganze Menge Text zom Thema (kann auch HTML enthalten) </topic> ...
Wie wird der Text gemappt?
Worauf ist zu achten, wenn der Text HTML ist?
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
@XmlRootElement(name = HelpTopic.TAG) public class HelpTopic { @XmlTransient public static final String TAG = "topic"; private String title; private String text; /** * Creates a new HelpTopic */ public HelpTopic() { } /** * Gets the title of the topic * * @return The title */ @XmlAttribute(name = "title") public String getTitle() { return title; } /** * Sets the title of the topic * * @param title * The title */ public void setTitle(String title) { this.title = title; } /** * Gets the text of the topic * * @return The text */ public String getText() { // <--- Was kommt hier hin return text; } /** * Sets the text of the topic * * @param text * The topic */ public void setText(String text) { this.text = text; } }
Danke
Geändert von Freak2k (28.10.08 um 16:21 Uhr)
-
29.10.08 22:29 #2
- Registriert seit
- Jun 2002
- Ort
- Saarbrücken (Saarland)
- Beiträge
- 9.886
- Blog-Einträge
- 29
Hallo,
versuchs mal mit @XmlValue
schau mal hier:
http://www.tutorials.de/forum/java/3...rshalling.html
http://www.tutorials.de/forum/java/2...-tutorial.html
Wenn du als text html zulassen willst musst du das in einer <![CData[....]]> Section schachteln.
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
Ähnliche Themen
-
JAXB und Java Type Mapping
Von saftmeister im Forum JavaAntworten: 3Letzter Beitrag: 26.02.10, 20:55 -
JAXB + Eclipse
Von meni im Forum JavaAntworten: 3Letzter Beitrag: 05.06.09, 11:06 -
von UVW mapping zu Kugel-Mapping überblenden ?
Von Principal im Forum Cinema 4DAntworten: 7Letzter Beitrag: 19.12.08, 17:20 -
Jaxb
Von nowacz im Forum JavaAntworten: 1Letzter Beitrag: 02.08.07, 12:31 -
JAXB: Frage zum Objekt-Mapping unter Verwendung von Inhalten
Von andersland im Forum JavaAntworten: 0Letzter Beitrag: 24.06.07, 00:46





Zitieren

Login





