managed-bean

Accessing a session scoped JSF managed bean in a servlet, is this guaranteed to be the same session as JSF uses?

孤街浪徒 提交于 2019-12-14 02:22:23
问题 When calling a managed bean in a servlet using MyBean myBean = (MyBean) request.getSession().getAttribute("myBean"); if it's about trying to call a SessionScopped managed bean : will this know exactly which bean instance to call (the one associated to the current user who was responsible of making the call). will this process be safe in case where many users use the servlet in the same time ? I want also know if it is possible to use an entity bean on a servlet. 回答1: If both are deployed on

Public field in Java

不羁的心 提交于 2019-12-13 13:24:03
问题 I have this Managed bean: import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.sql.DataSource; import javax.annotation.Resource; import javax.faces.context.FacesContext; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; // or import javax.faces.bean.ManagedBean; import org.glassfish.osgicdi

Target Unreachable identifier resolved to null

情到浓时终转凉″ 提交于 2019-12-13 05:32:31
问题 hi everyone Im new at jsp and this is my first project I learned managed beans, navigation rules and stuff and I cant see what the problem is in here. all my codes are those. Please help me because Im going crazy trying to find this. ERROR is /pages/login.jsp(31,2) '#{employee.username}' Target Unreachable, identifier 'employee' resolved to null Employee.java package com; public class Employee { private String username; private String password; private String name; private String department;

Creating a HashMap of type <String , Object>

为君一笑 提交于 2019-12-13 04:14:38
问题 In a previous post Creating a ToolTip Managed bean I was able to create a manged bean to collect and display tooltip text with only a single lookup and store them in an Application Scope variable. This has worked great. I am on the rather steep part of the JAVA learning curve so please forgive me. I have another managed bean requirement to create a HashMap Application Scope but this time it needs to be of a type String, Object. The application is where I have a single 'master' database that

@Autowired Spring service not injected in a managed bean

隐身守侯 提交于 2019-12-13 04:09:52
问题 I'm developping simple application with Spring using Spring Annotation, and I use Interface Repository for DAO Layer with @Repository and @Service for service layer. But the service class is not injected in the presentation layer and remains null. this is the Repository interface : @Repository public interface DemandeRepository extends JpaRepository<Demande, Integer> { } this is the service layer: public interface DemandeService { public void addDemande(Demande demande) ; } @Service public

How to call a managed bean method from an outputLink?

梦想与她 提交于 2019-12-13 03:35:17
问题 This may have been covered somewhere but I'm having trouble forming the question for search engine and no goods leads thus far. I'm working on a page that acts as entity view. Lots of results come from database and only a handful are displayed at a time. So you can imagine that I want to build a list of links that take user to another page of entities. This is all my code - no PrimeFaces or any other front-end nifty pagination solutions. At least for now. To the code: @Named @SessionScoped

Redeploy application after jsf managed bean modification

﹥>﹥吖頭↗ 提交于 2019-12-13 01:23:09
问题 Why is an application redeployment is needed for jsf managed bean modifications to take effect? Development environment: Eclipse Indigo. JBoss as 7. JBossAS Tools. Further explanation: If I modify a jsf page, I can visualize the modification after simply refreshing the page. But this is not the case for jsf managed bean modifications where I have to redeploy the application to visualize them. 回答1: Eclipse/JBoss cannot handle new classes, methods, nor fields during hotpublish/hotdeploy. They

Dynamically bind an Edit Box in a custom control to a managed bean

怎甘沉沦 提交于 2019-12-12 08:13:36
问题 I've read a number of excellent posts and articles about dynamically binding fields in a custom control, but they have all assumed a document data source. I want to allow the possibility of a managed bean data source. I tried setting the property type to com.ibm.xsp.model.DataSource or com.ibm.xsp.extlib.model.ObjectDataSource and neither of those work with the following xml: <xp:inputText id="input" value="${compositeData.dsn[compositeData.fieldName]}" > </xp:inputText> Where the control is

Illegal Syntax for Set Operation

断了今生、忘了曾经 提交于 2019-12-12 07:13:41
问题 I have a problem in connecting My xhtml page to the managed bean, the action on the commandButton works but when it comes to passing values it doesn't work. here is my jsf code: <h:form id="form" class="form-signin"> <p:panel id="panel" header=" Authentification" style="" > <h:panelGrid columns="2" rowClasses="3"> <h:outputLabel for="login" value="Nom d'utilisateur :" styleClass=""/> <p:inputText id="login" value=" #{authenticationBean.profil.login }" required="true" label="login" > <f

JSF ManagedBean - injected properties not working correctly on STATE_SAVING_METHOD=client

我怕爱的太早我们不能终老 提交于 2019-12-12 06:39:49
问题 I am into a problem from two days and I can not get out from this. The problem I am having is using a MangedBean property after the deserialization (I guess). The property (purchaseManager) is set up with Spring, and use a DAO which extends MyBatis as data mapper to interact with the DB. In fact, on the first access to the page, purchaseManager.getAll() inside init() method works fine. When i try to call refreshList() as an action from a button, I have a NullPointerException on the