• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Passing parameters on url

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am passing paramters on my url as follows. http://ippc1/address/main.faces?id=999

My main.faces page has no backing bean. It is only a page with menu links. Is there a way to create a session bean on a page like this, a page with no bindings? I would like to create a session bean that would hold the id passed on the url. I need to retain the id=999 for use throughout the application. Does anyone know how I can accomplish this?

Thanks,
Vic
 
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, SOMETHING has to implement logic to take the parameter from the URL and put it in a session object, then add the session object to the session. So you choice is what.

If you don't want JSF to create and catalog the session object you essentially either have to code your own servlet or do it all in JSP code fragments (I forget the correct name for that - it's a bad thing to do anyway).

It's a lot simpler to set up a session-scope backing bean and let JSF do the work for you.
 
Vic Newman
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your input Tim.
 
I don't get it. A whale wearing overalls? How does that even work? It's like a tiny ad wearing overalls.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic