Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF & dispalying data

 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm pretty new to JSF. Here's my dilemna.

I'm on a page where I enter some login details, I press the 'OK button' that calls some bean, which performs some computation - soo far no problem.

The database transaction gnereates some data, which is put inside a HashMap. (i.e. the data has been extracted into a HashMap, the DB connection is then closed) - so far so good. The HashMap has more HashMaps inside it.

Once this has been done, the user needss to be re directed to some page, where the data from the HashMap is extracted and then displayed on the JSF page - this bit i'm not too sure how to tackle. Any tips?

I have the Java Server Faces book by O'Reilly which hardly touches on this. I was also using the tutorial on http://www.coreservlets.com/JSF-Tutorial/ - again it has nothing concrete that I can use.

So guys if you could give me pointers, topics to read on or other tutotials that may help, please post below. Examples would be fabulous!

Thanks in advance
Regards
Zein
 
Josh Juneau
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like your original page will have a commandButton which initiates an action in the bean. This action method is where your transactions will take place. You can then store the values into this bean or another bean. The completion of the transaction should cause the page to be redirected to your second page which shows the calculated solutions.

In short...the action method which is invoked can store the values within a hashmap or even just variables within a bean (these variables can also be collections). The second page will reference the variables within the bean...which will show the results.

Here is a link which may assist you in retrieving values from other managed beans:

http://www.jsffaq.com/Wiki.jsp?page=HowToAccessOneManagedBeanFromAnotherManagedBean
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!