java-ee

Migrating from Spring security 2.0 to Spring security 3.0.7

我的未来我决定 提交于 2019-12-12 17:40:23
问题 I am having a project which uses Spring framework(migrated from 2.0 to 3.0.7) and Spring security 2.0. And I want to use Spring security 3.0.7. I have used MessageDigestPasswordEncoder, SecurityContextHolder. But now I've added Spring security 3.0.7 jar files to my project but it is showing some compilation issues to above classes. I need help for migration. Thanks in advance. 来源: https://stackoverflow.com/questions/8543229/migrating-from-spring-security-2-0-to-spring-security-3-0-7

The Eclipse plugin cannot communicate with the GlassFish server

偶尔善良 提交于 2019-12-12 17:38:55
问题 I need use Glassfish in a project we're currently working on in Eclipse IDE. My problem is after installing Glassfish Tools in Eclipse I manage to correctly create a new glassfish server en SERVERS tab but when I try to start it the following error message pop up: The Eclipse plugin cannot communicate with the GlassFish server.... The Eclipse plugin cannot communicate with the GlassFish server. A GlassFish Enterprise Server may be running on the same admin or HTTP port, but with a different

Can long-polling be achieved in Restlet by just making the thread sleep?

瘦欲@ 提交于 2019-12-12 17:24:00
问题 When making a GET request for a particular resource (i.e. ServerResource ) if I put the thread to sleep (to simulate long-polling) what would happen? Does the framework support this? From a Java EE standpoint what are the side-effects? Does it scale well with Tomcat (or any other server?) Has any-one tried implementing long-polling using Restlet by just making the request thread sleep? It seems restlet has no support for comet-style web applications and hence the question of such a hack , so

selectOneMenu selected value

社会主义新天地 提交于 2019-12-12 17:16:14
问题 Well, I need some clarification on selectOneMenu tag, using EL expression to get/set values <h:selectOneMenu id="variantsMenu" value="#{missionHandler.selectedVariant}" converter="#{missionHandler.variantConverter}"> <f:selectItem itemLabel="-- Select a Variant --" /> <f:selectItems value="#{missionHandler.variants}" var="variant" itemValue="#{variant}" itemLabel="#{variant.commercialName}" /> </h:selectOneMenu> I have this code, it displays a list containing ("-- Select a Variant--", Variant

How to get CDI in war AND EJB running if both are bundled in an EAR

会有一股神秘感。 提交于 2019-12-12 17:15:26
问题 I'm trying to build an enterprise application which is assembled in an EAR. This application should contain one or more ejb-jars and one or more war 's. I want to make heavily use of CDI , Interceptors and Producers. In the first step I want to use a Log-Producer which is placed in the ejb-jar in all areas of the application. What I did is creating a beans.xml in the ejb/META-INF and the war/WEB-INF/ folders. Creating the EAR works. But deploying to the Glassfish Server (3.1) fails with a

How to execute code after response in JavaEE

不问归期 提交于 2019-12-12 16:28:48
问题 I tried, unsuccessfully, to find a way to run code after response. In my case, a server sends me data in order to let me do my job but this action can be long (send SMS to 5000 contacts and check who received it, for example). The server expects HTTP 204 No Content response immediately to be sure that data has been received. Then my webapp will performs the action and send the status on a REST API. My problem is: How to send the response and then execute code ? For now I tried: doFilter

What happens to the prepared statements of an application when cassandra is restarted?

百般思念 提交于 2019-12-12 16:17:34
问题 Let's take a java ee application in production, which uses prepared statements. Let's assume that it prepared required statements on initialization of its session beans. In cassandra, each prepared statement has an id. If now, if cassandra is restarted, will java ee application also needs to get restarted? 回答1: Almost all Cassandra clients should support this situation without having to restart (all datastax drivers do to my knowledge). For example, in the java-driver, when a node goes down

Spring MVC @AutoWired response not working

不打扰是莪最后的温柔 提交于 2019-12-12 15:53:17
问题 I have : @Controller @RequestMapping(value="admin/*", method=RequestMethod.GET) public class AdminController { @Autowired private HttpServletRequest request; @Autowired private HttpServletResponse response; @RequestMapping public ResponseEntity<String> test0() { System.out.println("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"); return null; } } and the tag: <mvc:annotation-driven /> in my config.xml It should be enough I feel, but there is a problem with @Autowired: No matching

Custom JSP tag - detect existence of other instances

随声附和 提交于 2019-12-12 15:52:03
问题 Is it possible for a custom JSP tag to detect if there are other instances of itself within a page? If so, what's the preferred way to do this? My tag's output needs to be conditional dependent upon whether it's the only instance or not. Note that my page has three occurences of my tag, two of which have a different set of attributes from the third, so I know that there are two separate instances of the tag allocated from the resource pool. 回答1: You could make use of the PageContext

Having trouble adding PrimeFaces as EAR's library

橙三吉。 提交于 2019-12-12 15:51:54
问题 I'd like to use PrimeFaces in my Java EE 6 (Jboss AS 7.1.1Final) application with this structure: EAR |- lib/ | |- primefaces-4.0.jar | |- ejb-module.jar |- webbapp1.war |- webapp2.war However, when deploying to JBoss AS 7, I'm getting several exceptions such as: java.lang.LinkageError: Failed to link org/primefaces/context/PrimeFacesContextFactory (Please see the full stack trace here on PasteBin) For EAR's pom.xml, I'm using this Maven dependency for PrimeFaces: <dependency> <groupId>org