Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

GET method in JSF  RSS feed

clojure forum advocate
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any way to use get method with JSF apps ?
I don't know what the hell they were thinking, Why they don't support GET method ?
Posts: 19656
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They were thinking "there's a lot of glop that gets passed back and forth on JSF pages and GET has limitations size, so let's use POST".

If what you you really mean is "Why can't I call up JSF pages using Simple URLS?", you have a lot of company, and hopefully, someday someone will come up with a good solution.

It's perfectly permissible to mix ordinary JSPs/servlets and JSF pages in a webapp, however, so you can aways write something that supports GET, even if it's just going to forward to a JSF page.
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John it isn't that bad. You can call a JSF and use GET.

Suppose I want to call a page with eventID=1234 and the jsp file is init.jsp then


Will do the job. Just add the code below the taglib declaration in your JSP.

Now suppose I put a welcome declaration as index.jsp then write this and only this in the index.jsp file

Then you can call


And get the same result. For domain I mean the URL with or without 8080 depending on your config.

Now the handy thing about this is that if the eventID isn't set the eventID setter isn't called. So this gets really interesting for initialization purposes. If my faces is called through "GET" with a valid eventID then the eventID setter is called and I can do initialization steps. On all further requests to the faces the GET params are stripped so initialization is automatically skipped.

But yes JSF still gives me the "oh thats they way they wanted this done, hmmm"
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An other option is in JSF on the JSP file.
Set the property before these Tags:
<jsp:root ../>
< ../>

<jsp:setProperty name="mySessionBeanLoadedFrom_faces-config.xml_file" property="eventID" />

and you Got it.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!