jsf

jsf multiple validators

i need to know how to use m multiple validators for multiple fields like name and email id,and age and phone numbers. i have a clue that in ajax i can use multiple validaors for one form with different fields, but in jsf only one field like name validator or email validator is working, if i use two validators for the same form its not wo...

JSF h:outputStylesheet renders nothing

This <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"&gt; <h:outputStylesheet name="test.css" /> renders nothing. Do I have to add some configuration? The test.css is avaible in my resource folder. ...

How to display menu items from database

I have two classes representing menu items. First one is Category, it represents the parent menu items. @Entity @Table(name = "category") @NamedQueries({ @NamedQuery(name = "Category.findAll", query = "SELECT c FROM Category c"), @NamedQuery(name = "Category.findByCateId", query = "SELECT c FROM Category c WHERE c.cateId = :cat...

Enter-key Prevention Javascript Not Working for JSF 1.1 in IE

Notes on environment: JSF 1.1 using Infragistics component library. I'm using the following Javascript to attempt to prevent an 'Enter' keypress from submitting a form. function disableEnterKey(e){ var key; if(window.event) key = window.event.keyCode; else key = e.which; return (key !...

How to call a method in the bean when a JSF page is requested?

How to call a method in the bean when a JSF page is requested? Example I have a JSF page "MyPage.jsf" and its backend bean "MyBean" and it has a method "myMethod()". Is it possible to call the MyBean.myMethod() when MyPage.jsf is requested? ...

JSF2: selectOneMenu with custom selectItems: all items are selected

Thanks to some great articles here, I've been able to build a <h:selectOneMenu /> with selectItems containing objects. After providing a custom FacesConverter and fixing the missing equals()/hashcode() methods, I am able to use it to change the property of the backing bean and write it out to the DB. The only weird thing is that all HTM...

Problems with i18n

Hellos, all the information an pieces of code which follows, is what I am using. Hello, I am trying to internationalizate a web applicacion. For that, I set up: application-context.xml <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basename" value="m...

rich:dndParam with h:dataTable

Hi I am trying to implement drop feature of a4j with JSF Datatable. I have a datatable and I want to drop components into that data table. How do i do it. The code for dropping it in a tree works fine: Here's is the code of dropping it to the tree, but when i try to drop the same into a data table it doesn't work. ...

How to display HTML inside h:inputTextarea

How to display value with HTML tag inside h:inputTextarea? In DB I have column contain data, it contain plain text and HTML tag, I want display it on h:inputTextarea. How can I do it? ...

Does JSF1.2 has buit in CSRF protection?

Hi all, I have tested a JSF application with the CSRFtester tool, and the tool didn't report any CSRF problems. But I had read in the "OWASP_Top_10_2007_for_JEE.pdf", that all Java EE web application frameworks are vulnerable to CSRF and also some says we need to create a secret key for each session and append it to the url. By doing thi...

Handling exceptions in a JSF application

This may be too ambiguous of a question, but I'm looking for some help or best practices on handling exceptions in a JavaServer Faces application. Right now, whenever I catch an exception, I log it and then throw another exception that I created, say MyCustomException. This custom exception takes the Throwable object that was caught an...

problem with select statement in many to one relational in EJB3 and JSF

Hi All i wonder how to select between many to one relational i have two table Sub_category and Items sub category is own of relational, it contain list of Items Two class follow: @Entity @Table(name = "item") @NamedQueries({ @NamedQuery(name = "Items.findAll", query = "SELECT i FROM Items i"), @NamedQuery(name = "Items.findBy...

Netbeans, Glassfish deployment problem

I am developing a web project using Netbeans 6.9.1 and Glassfish 3.0.1. Everything was fine until I refector a sesion bean by renaming it from “outboxSession” to “OutboxSession”. Now the project cannot be deployed. I have tried many thinks like restarting Glassfish, restarting Netbeans, restarting my PC itself, deleting the built folde...

How to set up i18n for different languages?

Hello, I am working in internationalization. Can anybody help me how to set up for support different char types?? At least Spanish and German. I am using Rich faces, this is my configurationfile faces-config.xml <application> <locale-config> <default-locale>en</default-locale> <supported-locale>fr</su...

JSF2 Validation Clientside or Serverside?

Hi folks, I implemented my validation logic as follows: <h:inputText id="title" value="#{...}" required="true" requiredMessage="...some..text..." validatorMessage="...some..other..text..." > <f:validateLength minimum="10" maximum="50"/> </h:inputText> I read a lot about clientside...

Command Button Render ?

Hello All! I have one command button for task add to cart, it means when items quantity instock is geater than 0 command button will display but if items quantity instock is 0 it doesn't display. How can i write one method render with command button for my upon requirement? Edited =======================================================...

Retrieving Blob from MySQL database in Hibernate / JSF application

I am having some trouble properly retrieving blob data from my database using java in my JSF 2.0 application. The first problem I am having is on my getter method for the Blob named "file" I get an error saying that "Basic attributes can only be of the following types..." basically saying that I can not return a Blob object. My code look...

JSF h:ajax tag problem. The datagrid doesn't relaod

Hi this is my Code. It does not work for me. But it works in the solution of a friend. I don't know whats the reason. I don't get any error. All seems to be fine. But if i click my radiobutton nothing happens. I'm getting crazy pls help! <h:form id="form"> <h:panelGrid id="baseData" columns="2"> <h:selectOne...

JSF: logic based on iteration index

Pardon me for the title, that's the best my limited brain can came up this late. So, i have a list of string, something like [abc, def, ghi]. The question: in JSF, how do I iterate the list and create a string that look like this "abc, def, ghi" (notice the commas)? For those who have the urge to tell me that I'd better use a Java me...

JSF -- <ui:repeat /> over a java.util.Set?

Does the <ui:repeat /> tag support iterating over a java.util.Set? I've tried iterating over my JPA domain entity objects contained in a Set, but receive errors. Is there something I'm missing? Does an additional flag need to be present or something? ...