This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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
Hi.
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 ?
 
Bartender
Posts: 20343
111
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

domain/init.faces?eventID=1234

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

domain/?eventID=1234

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"
 
Greenhorn
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:directive.page ../>

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

and you Got it.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!