jsf

JSF data transfer between UI and business layer

Hi, We are using JSF in UI, Spring in business layer, Hibernate in persistence layer. Now my question is how to pass data from the JSF UI to spring business layer. Can I directly use my business object in my backing bean or should I transfer data between the layer through DTO? Can one explain me with clear explanation if possible with p...

How to consume RESTful web service in my JSF project?

Hello, As RESTful web services is url based and is not a object, we can't call methods on it. I have a simple web service with only one method in it with is @GET. I saw one screencast and it used some javascript library to consume the web service. But, how do i use it with my JSF project? I can't even inject it like a normal web service...

how to get http get request params in jsf 2.0 bakcing bean?

Hi all, I having trouble with passing http get parameters to jsf 2.0 backing bean. User will invoke URl with some params containing id of some entity, which is later used to persist some other entity in db. whole process can be summarized by fallowing: 1. user open page http://www.somhost.com/JsfApp/step-one.xhtml?sid=1 2. user fills s...

What's the best JSF implementation?

Hey everyone, I currently have a medium size Java web application sitting on top of Spring MVC. As much as I like (no sarcasm) coding straight HTML, CSS and JS, it's not possible for me to develop as fast as I'd like. I'm looking at different RAD frameworks to speed up my development. I'm looking at JSF implementations and component l...

EJB Update Model from selectOneMenu

Can anyone please tell me why the following isn't working? <h:selectOneMenu value="#{modelosController.selected.idMarca}"> <br/> <f:selectItems value="#{marcasController.itemsAvailableSelectOne}" /> <br/> </h:selectOneMenu><br/> <h:commandButton action="#{modelosController.createByMarcas}" value="Buscar" /> And the code:...

Why doesn't JSF 2.0 RI (Mojarra) scan my class' annotations?

I have a War and Jar project in my Eclipse-based JSF project. I have decided to use annotations to declare my FacesConverter, (among a myriad other things), rather than declare it using my faces-config.xml. @FacesConverter(value="passwordFieldStringConverter") public class PasswordFieldStringConverter implements Converter { public Ob...

creating dynamic rich:dropdownmenu

MethodExpression methodExpression = application.getExpressionFactory().createMethodExpression( FacesContext.getCurrentInstance().getELContext(), "#{PrismBacking.onItemClick}", null, new Class[] { ActionEvent.class }); menuItem.setActionExpression(methodExpression); I created a dynamic...

CDI/JSF and JAX-RS?

I would like to use RESTful services in a CDI/JSF2 application. I am not very familiar with JAX-RS however I have read that its lifecycle does not play well with CDI/JSF2. Is it possible to incorporate JAX-RS with CDI/JSF2 in a JEE6 stack? If not are there alternatives? thanks ...

faces-redirect=true in JSF

Hi! I am using the ?faces-redirect=true in my JSF2 since I would like to redirect the user so the URL will be changed. In JSF1.2 I added </redirect> in faces-config. In JSF2 I have to add to my url return home?faces-redirect=true. The problem is that I see faces-redirect=2 in the URL, what I haven't seen in JSF1.2 when I used How ...

JSF 2.0 h:selectManyListbox f:selectItems - always empty

I've got a JSF creation form using a selectManyListbox with selectItems inside (it should contain all tags available for projects). The selectItems list though is always empty - when the page renders, there's nothing in the Listbox. Still, the list in the backing bean contains 3 entries (checked that). What am I doing wrong? The backing...

JSF2 - Why does render response not rerender component setting?

I am getting the following problem: After my view is restored, validation of field causes JSF to skip to Render response phase (because required field is empty). But even though the current value (empty string) is rendered to show to user that he/she did not fill anything, the following statement is not executed: <c:if test="#{empty...

Can we have a component-scoped bean in a JSF2 composite component?

Hi, I was wondering how I could create "component-scoped" beans, or so-to-say, "local variables inside a composite component" that are private to the instance of the composite component, and live as long as that instance lives. Below are more details, explained with an example: Suppose there is a "calculator" component - something tha...

How to change the background color of a h:inputText control inside a rich:Panel

I need to change the background color of some <h:inputText> controls inside a rich panel based on a condition. This is to distinguish these controls as readonly. I tried using styleClass and style properties but both did not work. styleClass is ignored and style colors only half of the textbox. 1) styleClass code : In css : .readonl...

JSF 2: Facelets composition (template) not rendered for error-page

I'm using JSF 2.0 with Facelets in a Java EE 6 application server (GlassFish v3). I have configured an error page for exceptions, in web.xml: <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error-all.xhtml</location> </error-page> This is the /error-all.xhtml test page: <!DOCTYPE composition PUBLI...

chrome renders js different depending on the extension of the file to render [testcase included]

I was trying to implement an image panner I found here Chrome renders the same document differently depending on the extension of the file requested. I have created a test case, where it works when the file it's not named as test.xhtml You can download the test case from here Does anybody know why or how to solve it? I want my files to...

How to invoke JSF action on an anonymous class? EL cannot access it

I want to have a generic menu in my jsf (myfaces 1.2) application. <h:form> <h:dataTable id="dt1" value="#{portal.actionList}" var="item"> <f:facet name="header"> <h:outputText value="Menu" /> </f:facet> <h:column> <h:commandLink action="#{item.action}"> <h:outputText value="clickme"/> <...

How to store currently logged on user in DB?

Using Seam 2.1.2 and JSF 1.2 I wonder how to store the users login name in the database. In plain JSF I would simply lookup FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();in a backing bean and set the value into a persistent object. How can I achieve that the users name will be stored in the DB? ...

JSF-JSP cancel button returns a number format exception

I have a cancel button on a JSF-JSP page. It is handled by a method on the corresponding java class: public String cancel_action() { return "CANCEL"; This is configured in faces-config.xml as following: <navigation-rule> <from-view-id>/page2.jsp</from-view-id> <navigation-case> <from-outcome>CANCEL</from-outcome>...

Handling Uncaught Exception in JSF

Hi, I am developing exception handling framework. The exception handling framework is for a JSF application. The problem I am facing is tracking uncaught exception and displaying a generic message. I am able to handle uncaught exception for the action that are carried out(like on a click of a button), but I am not able to catch uncaug...

JSF Form is not showing up

My server is glassfish v3, my browser is firefox 3.6.3 and i am using Netbeans 6.8 My question is why the textfield is not showing up in my browser. I only see the label. <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt...