jsf

Jsf updates model value with old value

I am having some problems updating to the right value. On the page which you can see part of down under, there is a parameter 'change'. I think that this parameter is causing jsf to update the backing bean with the old value and thus do nothing. <h:panelGroup id="panel0"> <h:form id="changeForm"> <h:messages/...

Resetting component after validation error

i have created a custom validator class to do some logic whether the input field matches field requirements. I would like that the entered valued be displayed in the field, instead of it being blank. here's what i came up with, but it doesn't appear to work as expected... public void validateId(FacesContext context, UIComponent co...

JSF2, can I add JSF components dynamically?

Can I add JSF components dynamically? I know this should be possible in JavaScript somehow. Do anybody know how to do this in JSF? I think the major problem is how do I get or set values later via #{value}. I need to have a form with a button which should add one h:inputText to the form. Is this possible? ...

Calling servlet post from jsf in different war

Hi, I want to call a Servlet which exists in a different war from my war. When user clicks a button we need to call the post method of the servlet. To implement this I did see an existing example which is slightly different but works in that case. I am using jsf, so in the jsp there is a h:form with another html form inside of it. Below...

How to implement a possibility for user to post some html-formatted data in a safe way?

I have a textarea and I want to support some simplest formatting for posted data (at least, whitespaces and line breaks). How can I achieve this? If I will not escape the response and keep some html tags then it'll be a great security hole. But I don't see any other solution which will allow text formatting in browser. So, I probably s...

JSF Validation per property

When a form is submitted, some properties pass validation and some don't. If any of the properties fail validation, the model is not updated. I was wondering, is it possible to change this default behavior and have the properties that pass validation (and only them) updated with their new values in the model? ...

How conversation scope in implemented in CDI?

It is done through some session key that holds some structure? ...

Performance of resolving EL Value Expressions

I have a JSF2 application that renders a large table with complex content. Unfortunately, each request takes up to 6 seconds to process. Using simple debug output inside a phase listener, I could see that the performance loss distributes evenly over all phases that process the component tree. So I started up a profiler to see what's goin...

How to get a caller principal in my backing bean?

This is my backing bean (deployed to GlassFish): @ManagedBean @DeclareRoles({ "USER" }) @RolesAllowed("USER") public class MyBean { public MyBean() {} public final String getId() { Principal p = .. // how and where? return p.getName(); } } How and where I can get java.security.Principal object to understand who is logged...

JSF 2.0 vs Apache Wicket

I am pretty happy with JSF 2.0 and I am not familiar with Wicket. If I would switch from JSF 2.0 to Wicket... What would I like most in Wicket? What would I miss most from JSF 2.0? I guess it's only possible to answer this question if you have experience with both frameworks. Please don't compare with JSF 1.x. ...

Is there any standard JSF converter from inputText to URL?

I'm trying to convert inputText to java.net.URL in JSF page: ... <h:form> <h:inputText value="${myBean.url}" /> <h:commandButton type="submit" value="go" /> </h:form> ... My backed bean is: import java.net.URL; @ManagedBean public class MyBean { public URL url; } Should I implement the converter from scratch or there is some ...

(JSF) form-based authentication with my own user management

I would like to use form-based authentication as outlined in the book JavaServer Faces (O'REILLY). But instead of letting Tomcat manage the users, I would like to manage them myself: store them in a database etc. Can anyone give me a few pointers? Thanks in advance! ...

SelectOneRadio Problem

I'm trying to do a search form, depending on the selected item you can do searchs by start to end or month and year Is it possible to do a form look like this, with Facelets? using of preference SelectOneRadio ...

JSF2 Form Authentication whit database users

I'm currently using JSF 2 and icefaces framework for javascript I'm having some problems with j_security_check based on the url(that's not the point), that my taste is very strict my question is: Is there any better way of authentication, or some alternative? I find JAAS, but did not convince me because because the users are stored in ...

Custom validator with attributes in facelets

I have written a custom Validator that expects an attribute to be set. I know I have to write a Handler (TagHandler or ValidatorHandler?) to set that attribute, but I am having trouble doing it. <tag> <tag-name>validateCustom</tag-name> <validator> <validator-id>package.CUSTOM_VALIDATOR</validator-id> </validator> </...

how to do datatable filter using jsf ?

Hi, I want to do the filter in data table using jsf.In the datatable i have to filter the values what ever in the datatable. There is first dropdown and based on the drop down second drop drow will enable with value.Based on the that values display in the datatable. Could you give me some sample ot ideas.Please.... ...

JSF: Prefilled values with input text field?

I tried searching, but haven't found the answer. I see when you ask a question on stackoverflow, the input field for "tags" show the gray text "at least one tag such as...etc". Upon click, the gray text disappears and you can start typing your values. If I click off that, the instructions reappear. How do I do that? Are there out of...

Seam - EJB3 in Web Module/WAR?

I'm writing an application using Seam 2.2.x which will be deployed on JBoss 5.1. I have an EJB module with all of the business logic en EJB's. However, I'd also like to have statless session EJBs in the web module to act as action classes. Is this possible? Do I need to perform any additional configuration to get this working? I hav...

Problem with JSF forwarding and security constraint

I'm making a web application in which certain pages are login-protected. I have created a JDBC security realm in glassfish for this, and used Form authentication (Similar to the method described here) I'm using Navigation rules to redirect the user to the secured areas of the website: <navigation-case> <from-outcome>showResults...

Render jsf data table as it is populated with data

I have a data table with binded to a large list. I want to render the data table as that list is fetched, instead of waiting for the entire list to be fetched. Is this possible? ...