Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Passing parameters on url  RSS feed

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • 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
 
Bartender
Posts: 19735
92
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks for your input Tim.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!