javabeans

Long Running Task in Java EE WebApp + icefaces

ⅰ亾dé卋堺 提交于 2019-12-08 00:33:26
问题 I don't have much knowledge on Java EE but am currently learning it. I've come up with a project which involves a long running task (up to several minutes) invoked by the user. The task consists of several steps. Of course I would like to show the progress to the user. The project uses Java EE with JPA, JSF and Icefaces. It runs on Glassfish. An experienced colleague adviced the following pattern to me: Create a stateless, asynchronous EJB which creates a response object and processes the

GWT RF: How to share the same code in client and server

孤者浪人 提交于 2019-12-07 23:59:36
问题 I would like to use the same code to sort and manipulate objects in client and server sides. But I am facing a problem since in client we need a proxy interface representing the class of the server. Is there a way to use the same interface in both?, I know RF has a mechanism to copy bean attributes from the server instance to the client instance when it is sent through the wire. 回答1: As Thomas says in his answer, the only way in current GWT to have shared code in client and sever is

Java: Merge 2 “beans” to produce a new one

跟風遠走 提交于 2019-12-07 23:59:28
I need to take all the fields and collections from Bean1 and Bean2, sometimes apply some business logic, and produce Bean3 (all beans are hibernate/domain objects of the same type with a reasonably complex graph). Any thoughts on how to do this? Done something similar in the past? My ideas: Dozer (http://dozer.sourceforge.net/) BeanUtils (http://commons.apache.org/beanutils/) Handrolled solution A.N.Other cool solution? Any recommendations? Dozer is a nice bean mapping tool. However, it won't perform any business logic, of course. I should not be a problem to implement a business logic and to

JSF Managed bean in jar not instantiated

别等时光非礼了梦想. 提交于 2019-12-07 23:06:49
问题 I have created two jsf projects in JSF. One of them is a base project that has a single session bean. This base project is packaged into a .jar file (with a /META-INF/faces-config.xml file) and included in the other project (the clientproj). The problem is that when I run the client project, the session bean in the base project is not instantiated, and I get a NullPointerException. Details are as follows: Base Project - Session Bean package sbeans; import javax.faces.bean.ManagedBean; import

Dynamic Proxy in Java EL [closed]

余生长醉 提交于 2019-12-07 18:07:02
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . EDIT: I narrowed down the problem and posted the related question here. Please check it out! I am trying to use dynamic proxies to make HTML form processing easier. I am using a pretty plain MVC setup (no fancy

Java beans, annotations: What do they do? How do they help me?

删除回忆录丶 提交于 2019-12-07 15:34:41
问题 Here is what what I understand so far: Java beans are just to help other things (visual things?) interact with your code. I think that this is mostly for UI stuff because it is easier to design this visually. Is it bad practice to use Java beans for non-UI things? Java beans have getter and setter methods (bad OOP practice) and are serializable. In terms of annotations, I think that user defined annotations do not provide any functionality. Some annotations like @depretiated raise compiler

How to pass parameters from Servlet via Bean to JSP page with the help of Session?

家住魔仙堡 提交于 2019-12-07 09:18:11
问题 As mentioned below I have made changes to the code which looks like following example, but it doesn't show firstname and lastname in JSP: Servlet code: //.... HttpSession session = request.getSession(); Person person = (Person) session.getAttribute("person"); if (person == null) { person = new Person(); } person.setNewId(newId); person.setFirstName(firstName); person.setLastName(lastName); session.setAttribute("person", person); RequestDispatcher rd = request.getRequestDispatcher("jsp Address

What can be the reasons that Spring STS hangs?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 07:51:14
问题 Sometimes on the start STS hangs. Does it possible found the reason? May be exists log or possible start in debug mode? Also how I can distinguish between hangs completely and working very slowly? Thanks. P.S. How to fix ? 回答1: That is usually for the same resons descibed here tricks-to-speed-up-eclipse. Garbage collection or validation. If you have enough RAM I would suggest that you set -Xmx768m or higher (in eclipse.ini). Under Windows->Preferences->Validation you can switch off a lot of

Need help using <c:forEach> in JSP/JSTL

倖福魔咒の 提交于 2019-12-07 07:40:11
问题 I am trying to iterate through a 2d array of integers and represent them in a grid using the <table> tag. The catch is that I am not allowed to use any java-script. I know it is something to the effect of the below code, but more complicated. And boardArray returns a 2d integer array. So how would I extract the value at each cell? There is a predetermined size of the array as well. <c:forEach var="array" items="${bean.boardArray}"> <tr> <td>${print out contents of a row}</td> </tr> </c

Bean property 'xxx' is not writable or has an invalid setter method

拟墨画扇 提交于 2019-12-07 05:06:15
问题 I have spring web application. I have defined the controller bean which takes the bean of service as property. Also service bean takes the Dao. Dao is tested and working fine. Now the problem with service. Actually i'd make sure about the setters there ! so what is the problem ? Controller Bean : <bean id="listTypeController" class="me.web.servlet.controller.ListTypeController"> <property name="typeService" ref="typeService" /> </bean> Service Bean : <bean id="typeService"class="me.general