managed-bean

Cross field bean validation - why you no work

筅森魡賤 提交于 2019-12-01 14:41:47
I've got a little problem here with my application. I'd like to check if fields password and confirm password match together, so I tried to do it like in the first answer for this question: Cross field validation with Hibernate Validator (JSR 303) The problem is that it actually doesn't work and I HAVE NO IDEA WHY. Please, help me! This is my first post here, so please don't be too harsh for me. Here's my Annotation : /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package pl.lodz.p.zsk.ssbd2012.ssbd12.ValidationConstraints; import java.lang

JSF 2 managed bean does not get instantiated

荒凉一梦 提交于 2019-12-01 12:32:32
I am having this problem in this sample jsf project I created. Managed beans do not get instantiated. Bean class: @ManagedBean(name="loginMB") @RequestScoped public class LoginMB extends AbstractMB { private static final long serialVersionUID = -8523135776442886000L; @ManagedProperty("#{userMB}") private UserMB userMB; //getters and setters public String login() { UserSupport userSupport = new UserSupportImpl(); User user = userSupport.isValidLogin(email, password); if (user != null) { getUserMB().setUser(user); FacesContext context = FacesContext.getCurrentInstance(); HttpServletRequest

Passing request scoped variable passed as EL action method parameter does not work

冷暖自知 提交于 2019-12-01 11:06:10
I am using JSF 2.2 on Glassfish 4.1. I am trying to pass in a query parameter to as an action method argument as follows: // Example 1. This does not work. // at url http://localhost:8080/app/order.xhtml?email=test@email.com <p:commandButton value="Place order" action="#{orderManager.placeOrder(param['email'])}" /> (Know that param is an implicit EL object .) In the server log I have configured it to print the method parameter, but I can see that an empty string was passed-in, not "test@email.com" as I expected. I have confirmed that my overall configuration is working. If I replace the above

View scoped managed bean with setPropertyActionListener

南楼画角 提交于 2019-12-01 09:36:52
问题 I cant seem to get the view scoped managed bean to work with setPropertyActionListener: <h:commandButton value="Edit" action="edit-company.xhtml"> <f:setPropertyActionListener target="#{companyHolder.item}" value="#{company}"/> </h:commandButton> This works fine if companyHolder is session or request scoped but doesnt work if its view scoped. Is this normal? 回答1: A brand new view scoped bean is been created when a new view is created. The target view holds a different instance of the view

Null pointer when autowiring the bean into JSF Managed bean

走远了吗. 提交于 2019-12-01 06:43:55
I have developed a Email service using Spring Java mail and Velocity Template like below. Email.java @Component public class Email { private JavaMailSender mailSender; private VelocityEngine velocityEngine; @Autowired private ApplReviewService applReviewService; @Autowired private UserService userService; public void setUserService(UserService userService ) { this.userService=userService; } public UserService getuserService() { return userService; } @Autowired @Required public void setMailSender(JavaMailSender mailSender) { this.mailSender = mailSender; } public VelocityEngine

Use <ui:param> in a listener into a tag <p:ajax>

别等时光非礼了梦想. 提交于 2019-12-01 06:21:31
I'm using <ui:include> to load a data table (I'm using Primefaces). I want use <ui:param> in the listener into the tag <p:ajax> . I tested the code that is down, but not trigger the event onRowEdit or onRowCancel . This is my page: ... <ui:include src="../Componentes/tablaEditable.xhtml"> <ui:param name="columnas" value="#{tabla2FuentesHL7.dataTableColumns}" /> <ui:param name="bean" value="#{tabla2FuentesHL7.listTabla2FuenteDTO}" /> <ui:param name="aceptarEdicion" value="#{tabla2FuentesHL7.onRowEdit}" /> <ui:param name="cancelarEdicion" value="#{tabla2FuentesHL7.onRowCancel}" /> </ui:include>

Null pointer when autowiring the bean into JSF Managed bean

牧云@^-^@ 提交于 2019-12-01 04:25:53
问题 I have developed a Email service using Spring Java mail and Velocity Template like below. Email.java @Component public class Email { private JavaMailSender mailSender; private VelocityEngine velocityEngine; @Autowired private ApplReviewService applReviewService; @Autowired private UserService userService; public void setUserService(UserService userService ) { this.userService=userService; } public UserService getuserService() { return userService; } @Autowired @Required public void

Java 8 default interface methods not recognized as managed bean properties in EL

﹥>﹥吖頭↗ 提交于 2019-12-01 02:02:05
问题 I am trying to setup my own JSF tag libary. So I created a composite component with an backing interfaces as a blueprint to build a backing bean for this component. public interface CompLogin { String getUsername(); void setUsername(String username); String getPassword(); void setPassword(String password); String validateLogin(); default String getPasswordWatermark() { return "Passwort"; } default String getUsernameWatermark() { return "Loginname:"; } default String getLoginButtonValue() {

@ManagedProperty with request parameter not set in a @Named bean

﹥>﹥吖頭↗ 提交于 2019-11-30 20:41:47
I've a CDI managed bean wherein I'd like to set request parameters as managed properties: import javax.inject.Named; import javax.enterprise.context.RequestScoped; @Named @RequestScoped public class ActivationBean implements Serializable { @ManagedProperty(value="#{param.key}") private String key; @ManagedProperty(value="#{param.id}") private Long id; // Getters+setters The URL is domain/activate.jsf?key=98664defdb2a4f46a527043c451c3fcd&id=5 , however the properties are never set and remain null . How is this caused and how can I solve it? I am aware that I can manually grab them from

Error : non-serializable attribute value into ViewMap

雨燕双飞 提交于 2019-11-30 20:24:49
i have the same application in 2 systems(laptops) but its working in one but not in another.i get the following error in another system. i have also posted the code below.what i want to do is cascading dropdown with a button that calls method of a different managed bean, and a placeOrder button to add a record in database.but i get the following error at the time of page loading WARNING: Setting non-serializable attribute value into ViewMap: (key: stockOrderBean, value class: beans.stockOrderBean) SEVERE: Error Rendering View[/ClientTemplate/stockTrade.xhtml] java.io.NotSerializableException: