aspose file tools*
The moose likes JSF and the fly likes Render the contents from xml file to jsf page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Render the contents from xml file to jsf page " Watch "Render the contents from xml file to jsf page " New topic
Author

Render the contents from xml file to jsf page

Rakesh Jayaramaiah
Greenhorn

Joined: Sep 21, 2012
Posts: 3
Hello,
I have a XML page where i enter values(price,author,title) of various book and I have to retrieve values of 1 book at a time .. How do i get this done ?? i am new to jsf i tried using onsubmit such that when we click the button the values need to be updated

like for the first i get
title=ABC price=30$ author =abc and onsubmit it should become
title=PQR price = 20$ author = twg again on submit
title= GTU price = 40$ author = tyu .

Right now i get all the values in same page but i want it to come one after the other while onsubmit.
I wrote a function and made it display only title=ABC price=30$ author =abc
and upon refreshing page new contents get loaded title=PQR price = 20$ author = twg

but i want it work when i press a button instead of it changing on refresh .

Thanks in advance
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16141
    
  21

Welcome to the JavaRanch, Rakesh! Could you please read our Display Name rules (http://www.javaranch.com/name.jsp) and adjust your display name? Thanks.

I'm afraid I don't quite understand your question. Are you attempting to upload and process an XML data file?


Customer surveys are for companies who didn't pay proper attention to begin with.
Rakesh Jayaramaiah
Greenhorn

Joined: Sep 21, 2012
Posts: 3
Tim Holloway wrote:Welcome to the JavaRanch, Rakesh! Could you please read our Display Name rules (http://www.javaranch.com/name.jsp) and adjust your display name? Thanks.

I'm afraid I don't quite understand your question. Are you attempting to upload and process an XML data file?


Yes I am trying to Upload and process my XML data file . Please help me how would i do that
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16141
    
  21

Thank you for your co-operation, Rakesh!

In the case where JSF is used as part of an XML upload-and-process function, you would normally use one of the file upload controls to manage the actual upload process. The file upload controller would copy the incoming data to a temporary location and return access to that data. That's the same basic process regardless of whether your uploaded data was XML, straight text, or even binary files like PDFs and images. In fact, the only real difference between JSF's management of file uploads and vanilla J2EE uploading is that the actual processing of the uploaded data occurs in the action method of the commandButton that submits the form with the file upload(s) on it. Or, in the case of AJAX-controlled uploads, instead of an action method, it would be an AJAX listener method (which is almost the same thing).

Once the app has access to the uploaded data, it may do anything it wants to with it. You can use the Apache digester to reduce the received XML to Java objects. Or, for that matter, you can use SAX, STAX, JAXB, brute-force, some of the popular ORM implementations - in fact, there are more ways to parse XML in Java than I can easily remember. Anything that works in a stand-alone Java app can be used (as long as it doesn't spawn threads). Which means that you could offload that logic into a POJO bean and test it without having to launch a full-scale webapp server or use JSF-specific functionality.

Once the XML has been reduced to Java objects, of course, JSF will be able to use them just like it does any other Java objects.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Render the contents from xml file to jsf page