managed-bean

JSF2.0 State_Saving_Method client issues

允我心安 提交于 2019-12-12 03:56:31
问题 Im using Mojarra 2.1.3, Netbeans 7.0.1, primefaces 3.2. I am currently in a quandary whether to use STATE_SAVING_METHOD client or server. Currently Im setting the saving method to client. And this involves me doing adjustment to seriazibility of many objects. And putting transient keyword on the stateless facade session beans. @ManagedBean @ViewScoped public class SaProductController implements Serializable { @EJB transient SaProductFacade saProductFacade; @EJB transient SaKeywordFacade

Passing parameters between Request Scoped Managed Beans in JSF + EJB 3.1

依然范特西╮ 提交于 2019-12-12 03:48:29
问题 Our problem is a very basic, simple implementation of editing the database using JSF + EJB. Keeping things short: two separate XHTML views, use two separate Managed Beans @RequestScope. WebuserListBean and EditWebuserBean, and with @ManagedProperty we inject WebuserListBean, so we could obtain selected user data. So far no problems. Views are filled with data succesfully! BUT! We want to be able to edit the user! And here (to my surprise) we cannot overcome the problem. 1st try: Because the

Use of h:form in Facelets files in /WEB-INF opened by RequestDispatcher#forward() to execute methods of managed beans

梦想的初衷 提交于 2019-12-12 03:13:17
问题 I'm using Java EE for an enterprise application on Glassfish. I have some xhtml files in WEB-INF to prevent direct URL access, that I can access using a servlet. I need to call a method of a managed bean when the user press a button. The xhtml code I'm using is: <h:form><p:commandButton action="#{managedBean.testFunction()}" value="Test function" type="submit" ajax="false" styleClass="block" /></h:form> The problem is that the input of h:form seems to redirect me to the actual path to my

@ManagedBean and @Transactional - bug in Spring? Workarounds?

两盒软妹~` 提交于 2019-12-12 03:08:23
问题 I had the following JSF backing bean in my Webapp @ManagedBean class MyBackingBean implements Serializable { private MyHibernateRepository repository; ... @Transactional public void save() { .... repository.save(myObject); } } When it gets to the repository.save method call - I get the following error no transaction is in progress I've got two questions Is this because of a bug like this? I believe there are two workarounds - are there any others? 2.1 First workaround - using

externalContext.getSession(false) returns null

南笙酒味 提交于 2019-12-12 02:59:45
问题 My current platform is NB 7 rc 1 and I have a JSF 2 app with just one "managed bean". In time, I'm using Tomcat 7.0.34. Here is the code where the error occurs: @ManagedBean @SessionScoped public class CopyController implements Serializable { private static final long serialVersionUID = 1L; private String pathBancoSentencas; private List<Arquivo> arquivosUpload; private HttpSession session; private List<String> listaPdfs; public List<Arquivo> getArquivosUpload() { return arquivosUpload; }

JSF 2: possible to initialize session-scoped beans on session start?

99封情书 提交于 2019-12-12 02:45:01
问题 Is it possible in JSF 2 to initialize a session-scoped managed bean as soon as the session context is loaded? I know it's possible with Application Scoped beans and the eager attribute in the @ManagedBean annotation, but does something similar exist for session beans? I have a session-scoped bean that I want to have loaded regardless of if a specific page is visited. 回答1: Are you sure you need a bean? If it is some general initialization stuff, you can use a HttpSessionListener , and on

Bean properties not being updated

点点圈 提交于 2019-12-12 02:29:25
问题 My bean is viewscoped. I have a simple string property with a getter and setter. The getter works fine(checked by initialising the property), but not the setter. In the setter method I am building a Stringbuffer using each of the incoming parameter. Code: public String getParamval() { return paramval; } public void setParamval(String paramval) { logger.info("Incoming value:" + paramval); pvals.append(paramval); this.paramval = "VAL"; } Is that wrong? I have tested within the setter to see if

Getting id of item in list<object> in JSF

江枫思渺然 提交于 2019-12-12 00:46:44
问题 I don't have any idea what approach and how I should start coding to get the id of a specific object item when a form button is clicked. The Product Id values showing are primary keys of the product table I created. I'm coming from Swing programming and in Swing I can easily use the JLabel.getText(); to get the product Ids 1,4,5,6 shown on the screenshot. But I guess it's different with JSF . Also, these object values are contained in a ui:repeat loop frames.xhtml <ui:repeat value="#

How to choose the right bean scope?

好久不见. 提交于 2019-12-12 00:26:24
问题 I noticed that there are different bean scopes like: @RequestScoped @ViewScoped @FlowScoped @SessionScoped @ApplicationScoped What is the purpose of each? How do I choose a proper scope for my bean? 回答1: Introduction It represents the scope (the lifetime) of the bean. This is easier to understand if you are familiar with "under the covers" working of a basic servlet web application: How do servlets work? Instantiation, sessions, shared variables and multithreading. @Request/View/Flow/Session

com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException

微笑、不失礼 提交于 2019-12-11 14:14:31
问题 I am trying to deploy a newspaper website. It works fine with the main page (list of articles) but when I click on one of them, to go to the article page, I get this Exception: oct 31, 2014 11:41:35 AM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException SEVERE: Error Rendering View[/noticia.xhtml] java.lang.NullPointerException at java.net.URLEncoder.encode(Unknown Source) at com.sun.faces.context.UrlBuilder.addValuesToParameter(UrlBuilder.java:318) I am using