java-ee

Estructuration of multi module project. how to packaging modules?

五迷三道 提交于 2020-01-03 04:13:09
问题 i'm creating the estructure of a multi modul project with maven. The parent's pom: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven- 4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>cat.base.gpt</groupId> <artifactId>gpt</artifactId> <version>0.0.1</version> <!-- application version --> <packaging>pom<

Custom like predicate to handle custom user defined types (Hibernate UserType)

半腔热情 提交于 2020-01-03 04:00:27
问题 I recently stumbled upon a problem where I have to build a JPA criteria with like predicate that accepts a custom type that is an implementation of UserType. The custom type I'm dealing with is nothing more than String wrapped with some additional info. I've done it for Hibernate criteria with implementing the Criterion interface from Hibernate and it works fine. I have to do the same now for JPA, but the Hibernates implementation of Predicate, the LikePredicate which is created when calling:

Java handling special character in request.getParameter

删除回忆录丶 提交于 2020-01-03 03:40:08
问题 I am trying to get parameter in my java class that contain a special character. I have added it as follows <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> I have these two parameters: (1)3 –days System Admin (6EE SP1) training at VMware Bangalore location (2)Daiichi:eDossier – Phase1 new_6500004691 After submitting the page i get the perfect result,but two parameter names gets change as below: (1)Daiichi:eDossier ââ¬â Phase1 new_6500004691 (1)3 âdays

Check if username already exists in the register form

落花浮王杯 提交于 2020-01-03 03:12:10
问题 I have the follwing register form: <h:form id="newCustomerForm" > <fieldset> <legend>Register Form</legend> <table border="0" > <tbody > <tr type="text"> <td> <p:outputLabel value="Account Login :" for="pseudo"/> </td> <p:spacer height="5px" /> <td> <p:inputText id="pseudo" value="#{customerMB.login}" title="Pseudo" required="true" requiredMessage="The Pseudo field is required."/> <p:watermark for="pseudo" value="Login" /> <p:message for="pseudo"/> </td> </tr> <p:spacer height="5px" /> <tr

Servlet send image from server and save in client

邮差的信 提交于 2020-01-03 03:09:05
问题 I'm new and just developing on J2EE. I am modifying an existing application (an OpenSource project). I need to save an image on a client sent by the server, but I do not know how. This activity must be done in a transparent manner without affecting the existing operation of the application. From the tests done I get this error: java.lang.IllegalStateException: getWriter () has Already Been Called for this response. How should carry out this task, according to your own opinion? How do I save

CDI not working with Java EE Batch under jberet implementation

二次信任 提交于 2020-01-03 03:01:19
问题 I have a Java EE batch application implemented with jberet deployed on WildFly application server. This application also expose a REST api to trigger a job on demand. I have following class creating beans to be injected: public class Factory { @Produces public JsonValidator getJsonValidator() { return JsonSchemaFactory.byDefault().getValidator(); } Injecting the above bean in the REST api works fine: @Path("my-resource") public class MyResource{ @Inject private JsonValidator jsonValidator;

How to put variable in OGNL tag

試著忘記壹切 提交于 2020-01-03 00:01:18
问题 <input type="radio" name="${questions.qid}" value="${questions.ans1}" <s:if test="%{(#session.map.get(1)).equals(\'ans1\')}">checked</s:if>><s:property value="#attr.questions.ans1"/> In this code 'questions' is a list which contain questions object with String question,ans1,ans2,ans3. In my program, I will make it appears in browser like Question 1 (RadioButton) Answer 1 (RadioButton) Answer 2 (RadioButton) Answer 3 Question 2 (RadioButton) Answer 1 (RadioButton) Answer 2 (RadioButton) Answer

How to put variable in OGNL tag

不打扰是莪最后的温柔 提交于 2020-01-03 00:00:39
问题 <input type="radio" name="${questions.qid}" value="${questions.ans1}" <s:if test="%{(#session.map.get(1)).equals(\'ans1\')}">checked</s:if>><s:property value="#attr.questions.ans1"/> In this code 'questions' is a list which contain questions object with String question,ans1,ans2,ans3. In my program, I will make it appears in browser like Question 1 (RadioButton) Answer 1 (RadioButton) Answer 2 (RadioButton) Answer 3 Question 2 (RadioButton) Answer 1 (RadioButton) Answer 2 (RadioButton) Answer

How to setup a JMX Notification Listener?

北慕城南 提交于 2020-01-02 21:59:07
问题 This is a follow-up of How to stop message processing before undeploying? I want to configure a JMX Notification Listener for undeployment events, but I don't know how to set the mbean name correctly. We are currently using JBoss 4.2.3. The following attempt won't trigger any notification. <mbean code="jboss.example.NotificationListener" name="jboss.example:name=NotificationListener"> <attribute name="SubscriptionList"> <subscription-list> <mbean name="jboss.j2ee:service=EjbModule,type=jmx

Java EE installer crashing on Mac OS X Mavericks

时光怂恿深爱的人放手 提交于 2020-01-02 18:05:13
问题 Trying to install Java EE 7/Glassfish 4 on OS 10.9 Mavericks and it crashes every time. I have tried installing the Apple JDK and the Oracle JDK and neither work. Has anyone ran into this? I remember installing on 10.8 and it worked just fine. Thanks! Environment Variables: $ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home Output: $ chmod +x java_ee_sdk-7-jdk7-macosx-x64.sh $ ./java_ee_sdk-7-jdk7-macosx-x64.sh Extracting the installer archive... Extracting the