jakarta-ee

What is difference between @Transactional(rollbackFor = Exception.class) and @Transactional(propagation=Propagation.REQUIRED)

泄露秘密 提交于 2020-01-15 10:15:32
问题 @Transactional(rollbackFor = Exception.class) public void foo1() { `/**Some Code**/` } @Transactional(propagation=Propagation.REQUIRED) public void foo2() { `/**Some Code**/` } 回答1: @Transactional(propagation=Propagation.REQUIRED) and @Transactional(rollbackFor = Exception.class) are roughly the same. As propagation=Propagation.REQUIRED is the default. So with that in mind they are equivalent to @Transactional(propagation=Propagation.REQUIRED) and @Transactional(propagation=Propagation

What is difference between @Transactional(rollbackFor = Exception.class) and @Transactional(propagation=Propagation.REQUIRED)

两盒软妹~` 提交于 2020-01-15 10:14:29
问题 @Transactional(rollbackFor = Exception.class) public void foo1() { `/**Some Code**/` } @Transactional(propagation=Propagation.REQUIRED) public void foo2() { `/**Some Code**/` } 回答1: @Transactional(propagation=Propagation.REQUIRED) and @Transactional(rollbackFor = Exception.class) are roughly the same. As propagation=Propagation.REQUIRED is the default. So with that in mind they are equivalent to @Transactional(propagation=Propagation.REQUIRED) and @Transactional(propagation=Propagation

Posting a multipart request with image in Android?

喜夏-厌秋 提交于 2020-01-15 09:49:47
问题 I am trying to post a JSON representation of my object and an optional image to my Spring backend. However, I am having major trouble posting a request with an image. I have managed to post the first part to the server; the JSON object. However when I try to add a second part which is an image captured by the user nothing happens. I don't see any stacktraces. What am I doing wrong and how do I post an image along the request. This is what I have... String boundary = UUID.randomUUID().toString

Data Access control in Java EE technologies

你。 提交于 2020-01-15 09:49:06
问题 I am working on a project that requires that i implement a mechanism for controlling data access to the content that displayed on the pages. First off to clarify, i am not refering to the ability for different users to log on to a specific page and or view specific pages. That is a different type of access control. I am more interested in the "Data Access" i.e. where multiple users can view the same page but the data that is displayed depend on the data access control privileges they have. I

Compile dynamically java class web project

末鹿安然 提交于 2020-01-15 08:53:29
问题 I'm developing a web application where I can import a java code, compile and then execute it. This class might have some imports from another libraries, which I added to my classpath. Running it as a desktop application, it works, but running under wildfly 9.0.2 it doesn't find my classpath libs and so, I have errors to compile my code. Do I have to change any setting on wildfly configuration? I tried my code with and without maven. I'm using this lib to compile my code, and like I said, it

How to return Array Values as a output to a Method in Java

时光怂恿深爱的人放手 提交于 2020-01-15 08:17:11
问题 I am new to Java .I am working on my previous post link. I want to return specific extension(like .txt ) file names under directory. For this,I wrote the following method with 2 arguments. public void ListOfFileNames(String directoryPath,String fileType) { //Creating Object for File class File fileObject=new File(directoryPath); //Fetching all the FileNames under given Path File[] listOfFiles=fileObject.listFiles(); //Creating another Array for saving fileNames, which are satisfying as far

CDI: pass through qualifier from one injection point to the other

北城余情 提交于 2020-01-15 06:43:12
问题 I'd like to kind of pass-through a qualifier annotation using CDI. With that I mean that I'd want to add a qualifier to an injection point with that qualifier not being applied directly for the "first-level" injection target (because there is only one implementation for this) but a field within ("2nd level") the injected EJB. Is this possible with CDI? Does it maybe already work out-of-the-box? It should look similar to: @Stateless public class MyFirstLevelEJB { @Inject //this guy has

Passing a value to a custom tag

青春壹個敷衍的年華 提交于 2020-01-15 06:19:27
问题 I have a custom tag that I'm trying to pass a String to. It was giving me a NullPointerException. After making some edits suggested below, I am getting ${note} instead of the processed output I had intended. Can anyone help me with this? Here is the relevant code from the JSP. I'm using Struts 2 in my form, and I've marked the line where I'm calling my custom tag. <s:iterator value="bulletins"> <s:if test="approved == false"> <s:form action="ApproveBulletin" method="post"> <table border="2"

Can an EJB be called from a desktop application?

戏子无情 提交于 2020-01-15 05:00:27
问题 I am new in Java EJB 3.0. It is possible to call a (session) bean—deployed on JBoss—from a desktop application client? Thanks in advance. 回答1: Yes you can. Some specifics are here (references EJB2 but it the same for EJB3 when it comes to remote clients): http://www.theserverside.com/discussions/thread.tss?thread_id=9197 Paraphrased: Hashtable env = new Hashtable(); env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); env.put("java.naming.provider.url", "jnp:/

How to combine these regex for javascript

只愿长相守 提交于 2020-01-15 04:56:05
问题 Hi I am trying to use regEx in JS for identifying 3 identical consecutive characters (could be alphabets,numbers and also all non alpha numeric characters) This identifies 3 identical consecutive alphabets and numbers : '(([0-9a-zA-Z])\1\1)' This identifies 3 identical consecutive non alphanumerics : '(([^0-9a-zA-Z])\1\1)' I am trying to combine both, like this : '(([0-9a-zA-Z])\1\1)|(([^0-9a-zA-Z])\1\1)' But I am doing something wrong and its not working..(returns true for '88aa3BBdd99@@')