Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting the submitted form name  RSS feed

 
Ajay Dhar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how to get the submitted form name in JSF. I was thinking that it would be stored somewhere in Faces Context. I'm pretty sure that its not in the HTTPServletRequest object in Faces Context. It's important for me to get the name of the form that is submitted.

Thanks.
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, in my experience, questions like that usually indicate you're trying to solve some other problem. And it's just possible that brute-force access to the underlying HTML form name might not be the most graceful solution to that outer problem when you're using JSF. So it would be good if you could tell us more about what you want to accomplish and why, as opposed to jumping right into "how".

As far as the "how" goes, the digested JSF view is in a tree structure anchored by the ViewRoot and there are various accessor methods that allow running up and down the View. But stuff like that I don't do very often and I've been doing JSF for a long time. There's usually a simpler, more portable solution.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!