• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Use multiple scopes in a page?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good Day,


After trying to figure out how to do it, I failed.

Can somebody give me a hint on how to do it?

This was my problem yesterday,

Use SessionScope and RequestScope at the same time?

Thanks in advance.


Binnie

 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why did you post a new thread instead of continuing with the old one? There seems to be no reason for this and you even refer your own thread here!

Also, post your current code so we can determine where you went wrong.
 
Binnie Fabian
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good Day,

Sorry about that,

Well here's my code.

Session Scoped


Request Scoped


view.jsp



add.jsp



The index.jsp just calls the two jsp pages.



Regards,

Binnie







 
Ilari Moilanen
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not very familiar with RichFaces but I don't see any obvious problems here. What exactly is the problem anyway? Does doing something throw an exception? And what that exception is?

You say in your previous topic that "When I tried to use them inside the page, only the RequestScopeBean functions." so is that still the problem? And what do you mean by "not functioning"? If you put logging lines inside your methods (including getters and setters) you can see what exactly gets called (and and in what situation) and what does not.

EDIT: and you seem to be doing the basic mistake of catching exceptions in you code but not logging what that exception was so at least all those exceptions do go unnoticed.
 
Binnie Fabian
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good Day,


Here is my situation;

Back then I have a running drop down menu that displays the description of the selected item on a text area.

It is running with a SessionScopedBean, coz if I use RequestScoped, the text area wont populate.

Every thing seems fine until I added a new feature which is to ADD records.

I used a modalPanel (RichFaces) to add records and it only works (based on my output) inside a RequestScopedBean.

If I use SessionScoped, I'll get this error:

/jobPosition/view.jsp(26,12) '#{jobPositionBeanRequestScoped.jobPositionList}' Error reading 'jobPositionList' on type com.practice.bean.JobPositionBeanRequestScoped

(Note: I was only using one backing bean for the above statement.)


That is why I asked back then if it is possible to use them both at the same time.

Mr. Tim and you replied that it is possible.

Knowing that it is possible, I tried it on my own first but I failed.

Then I asked again and made this topic.

And again I'm sorry for making another one.


Everything is working the way I wanted it now.

Thanks for your time.


BTW thanks for these, it helped me a lot.

  • If you put logging lines inside your methods (including getters and setters) you can see what exactly gets called (and and in what situation) and what does not.
  • EDIT: and you seem to be doing the basic mistake of catching exceptions in you code but not logging what that exception was so at least all those exceptions do go unnoticed.



  • Regards,

    Binnie
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic