Advertisement

04.29.2008 at 01:02AM PDT, ID: 23361287
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Display Clob / XML in jsf page
Tags: Java JEE JSF
Hi,

I want to display the content of a clob in a jsf via jstl.

I have a DB interface via JPA an modeled a DBSchema which a field contains XML (XMLType)
Now I want to use a Bean to display this via jstl in my webpage.
As the code shows, it workt well for standard types as Strings,Numbers and so
But how can I show the clob object. it always displays me the name of the class(oracle.xml.parser.v2.XMLDocument@xxxxx) or sth.
I using EclipseLink, and the XMLType is supported.

Anyone nows how tho handle that

rgds,
- Mark
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:
// extract of my Table Class
private String xmlData;
 
	@Lob
	@Column(name = "XMLDATA", ... )
	public Clob getXmlData() {
		return this.xmlData;
	}
 
	public void setField(String xmlData) {
		this.xmlData = xmlData;
	}
 
// extract of my jsf
 
	<c:forEach var="item" items="#{TestBean.EntryList}">
		<tr>
		<td>${item.foId}</td>
		<td>${item.foName}	</td>
		</tr>
		<tr>
		<td colspan="2">
			${item.xmlData}
		</td></tr>
	</c:forEach>
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: BitBreaker
Solution Provided By: aiklamha
Participating Experts: 1
Solution Grade: B
Views: 30
Translate:
Loading Advertisement...
04.29.2008 at 01:17AM PDT, ID: 21460390

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.29.2008 at 01:29AM PDT, ID: 21460447

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.29.2008 at 01:37AM PDT, ID: 21460477

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.29.2008 at 01:54AM PDT, ID: 21460530

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.29.2008 at 02:06AM PDT, ID: 21460580

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.29.2008 at 02:25AM PDT, ID: 21460666

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.29.2008 at 07:35AM PDT, ID: 21462661

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.29.2008 at 07:55AM PDT, ID: 21462868

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.29.2008 at 08:46AM PDT, ID: 21463360

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.29.2008 at 08:49AM PDT, ID: 21463399

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
04.29.2008 at 01:17AM PDT, ID: 21460390
use oracle.ide.xml.XMLUtil class's toString(oracle.xml.parser.v2.XMLDocument xmlDocument)  method... to get the string
 
04.29.2008 at 01:29AM PDT, ID: 21460447
first a little correction of the snippet above

      public Clob getXmlData() {
            return this.xmlData;
      }
should be
      public String getXmlData() {
            return this.xmlData;
      }

@aiklamha
  and how should i do this ??
I guess the interface is generated with methods for java.lan.string, and I think the framework calls the toString method, and i don't know how to overwrite this ?? I think in the background it works fine, but if I change the parameter from string to lets say ...w3c.Document, or ...parser.v2.XMLDocument i get an converstion/validation exception

rgds
- Mark



 
04.29.2008 at 01:37AM PDT, ID: 21460477
XMLDocument doesn't have an overridden toString method.. if you want to override.. you need to extend oracle.xml.parser.v2.XMLDocument and implement your own toString method...

by the way.. .where have you used instance of oracle.xml.parser.v2.XMLDocument ??
what is the type of table column?
 
04.29.2008 at 01:54AM PDT, ID: 21460530
The type is a XMLType on ana oracle 10g.
I use Eclipse, and do a reverse engineering of the DB schema, It generates me the DAO classes, and the bean for this table with getters and setters. I changed also from Toplink essentials to Eclipselink, cause Toplink essentials doesn't support the XMLType. I'm a little confused, because I see the JPA framework works correct by seeing that the getter returns (XMLDocument@...). OK there is a XMLdocument. but I don't know how become control of this document.

Another way.
how would you work in this case, if you have such a field in the DB, and want to display that in a jsf.

 
04.29.2008 at 02:06AM PDT, ID: 21460580
I didn't work with EclipseLink.. what i am confused about is; if xmlData's class is  XMLDocument .. then why EclipseLink generated getter which is returning a Clob....

I would first try to replace Clob with XMLDocument.. replace private String xmlData; to private XMLDocument xmlData... and then in getter method i would use this XMLUtil class or by using print method of XMLDocument to give me actual String data held by xmlData Object ...
 
04.29.2008 at 02:25AM PDT, ID: 21460666
in the code above there is a copy/paste error it doesn't generate me get/set for type clob, thats because of playing around by my site. it generates get/set for string.
I would do this the same way, but it doesn't work ;-(

if I have the String get/set, I become the (XMLDocument@.....)
and if I change the get/set to
your way getter String setter XMLDocument
--
Exception [EclipseLink-7174] (Eclipse Persistence Services - 1.0 (Build SNAPSHOT - 20080409)): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The getter method [public java.lang.String ] on entity class  does not have a corresponding setter method defined.
--
and last but not least
getter/setter XMLDocument

javax.servlet.ServletException:
Exception Description: The object [oracle.xml.parser.v2.XMLDocument@6ed3199e], of class [class oracle.xml.parser.v2.XMLDocument], from mapping [org.eclipse.persistence.mappings.DirectToFieldMapping[xmlField-->DB.DBOBJECT.XMLFIELD]] with descriptor [RelationalDescriptor(dbobject --> [DatabaseTable(Y.DBOBJECT)])], could not be converted to [class [B].

???
M.
 
04.29.2008 at 07:35AM PDT, ID: 21462661
Anybody else a solution ??

rgds,
M.
 
04.29.2008 at 07:55AM PDT, ID: 21462868
the error gives me the idea that the class XMLDocument you are using in setter or getter is different than the class which EclipseLink is using to map with XMLField internally... well i can't tell any thing more..

see if this can help

http://wiki.eclipse.org/Introduction_to_EclipseLink_Expressions_(ELUG)#XMLType_Functions

http://dev.eclipse.org/newslists/news.eclipse.technology.eclipselink/msg00047.html
Accepted Solution
 
04.29.2008 at 08:46AM PDT, ID: 21463360
Thanks aiklamha !
the Doc in the first link give me a hint how to do this.
in SQL i would use select extract(xmlfield, '/').getStringVal() and I see with  ELUG I'm able to do things similar.
anyway I have to find out how I can use and where i can place the Expression Object.

I will give you the Point, because of taking care, and help me find a hint ;-)

rgds,
M.
 
04.29.2008 at 08:49AM PDT, ID: 21463399
Glad that helped :-)
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628