Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Command line url params and JSF  RSS feed

 
M Burke
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible for JSF to create 'get' parameters like a normal link tag when it calls a page?

When I use a command link in JSF, the nav rules are set in the config file, then I call the object method...

<h:commandLink value="Call Get"
action="#{IndexHandler.callGet}"/>

I would like it to generate an output that contains command line params like this...

\callGet.jsp?param=1;param=2

Can it do it?
 
Kavita Tipnis
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in faces-config.xml you can specify which bean receives the parameters :


you can use f:param tag for your commandlinks that will send the parameters to the url


For further reference
Communication
 
M Burke
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see, thanks for the insight
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was useful (and timely, for me!). However, I think it's only going to work if you define the bean with "request" scope, since session and application scope beans don't have direct connection to a URL.
 
Kavita Tipnis
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it will work only for request scope, but you can take the parameter and store it in a session bean instance varaible , that should work.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!