• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Bind JSF Component to XML data element

 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Guys,

I am looking for solution like xforms where we can bind input component to our xml data model but should work with JSF.

If I explain in other way, In my managed bean I have a field for whole xml data, (may be xml as String, Stream, JSON, or DOM Document) and from my view (xhtml) I need to access / display some xml element using xpath or similar technique.

eg,

model
<employee>
<id>01</id>
<name>Mali</name>
</employee>

view
<h:input value"//employee/name">

Why I need such solution,
My Java Model is very dynamic, which can be changed from client to client, So I like to pass data in xml, and store in xml format, (db2, oracle supports xml data), So I need change only view, and keep services untouch,

Thanks
 
Saloon Keeper
Posts: 22482
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, you might be better off using Cocoon, which is designed for XML, rather than JSF.

JSF is designed to run as a classical Model/View/Controller framework using JavaBeans (POJOs) for the models. You can adapt JSF to an XML backend using something like JAXB to convert the underlying XML to a directed graph of POJOs. And take advantage of the fact that JSF View EL isn't compiled until run-time to reduce dependency on pre-defined objects and properties. However, it would take a fair amount of care to make a workable framework out of that, so I'd definitely look at Cocoon first.
 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:Actually, you might be better off using Cocoon, which is designed for XML, rather than JSF.

JSF is designed to run as a classical Model/View/Controller framework using JavaBeans (POJOs) for the models. You can adapt JSF to an XML backend using something like JAXB to convert the underlying XML to a directed graph of POJOs. And take advantage of the fact that JSF View EL isn't compiled until run-time to reduce dependency on pre-defined objects and properties. However, it would take a fair amount of care to make a workable framework out of that, so I'd definitely look at Cocoon first.



Hi Tim,

Thanks for the prompt reply.

JAXB would not work for me since I will have to change to core model. I will look into Cocoon.

Thanks again.
Chaminda
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic