Stefan Frings wrote:The hidden button does not work beause the action handler answers with a page, which is the same page in this case. So the page will get re-loaded and because the onload script clicks the button again, the page gets reloaded in an endless loop.
Sometimes the solution is so easy to oversee it:
This calls the init method when the page gets loaded.
If you use the older JSF 1.2 release, then write #{myBean.init} and name the method getInit().
Tim Holloway wrote:
Rodney Hirokane wrote:
Bear Bibeault wrote:If you are using JSF, then this is in the wrong place. Which is it? JSP or JSF?
JSF using JSP for the web app development but maybe you can help better clarify for me. I thought JSF provided the framework that my JSP pages are developed in. My web page files have a .jsp extension that needs to be compiled and the eventual end product is an .ear that is deployed to the application server. I use JSF tags within my .jsp page and also use both session and backing beans for accessing the database. Isn't the JSP being extended using the JSF tags? For what it is worth my development environment is IBM Rational Software Architect and DB2 and my Application Server is Websphere.
Thanks,
Rod
No. JSF started off being based on JSP, but that was long ago. These days, the ".jsp" files are not compiled to produce servlets like "real" JSPs are. Instead, they're used as templates to be digested into JSF View trees. So a ".jsp" suffix is really an illusion. As of JSF2.0, the preferred mechanism is Facelets, and Facelets resources normally have an extension of ".xhtml", in fact.
All of which provide the primary reasons why scriptlets and JSTL don't work well on JSF "jsp"s.
An additional caveat for WebSphere, BTW. Depending on which version and what service packs are in effect, JSF support is integrated into the WebSphere server itself. That makes some things simpler, but you do have to make sure that the version of WebSphere you're using is sufficiently advanced to support the level of JSF that you're developing in.
Bear Bibeault wrote:If you are using JSF, then this is in the wrong place. Which is it? JSP or JSF?
Bear Bibeault wrote:You should format the data more appropriately before getting to the JSP.
Seems like a Map might be a good fit.