jakarta-ee

How to handle internal calls on Spring/EJB/Mockito… proxies?

一世执手 提交于 2020-01-28 05:09:31
问题 As you many know when you proxy an object, like when you create a bean with transactional attributes for Spring/EJB or even when you create a partial mock with some frameworks, the proxies object doesn't know that, and internal calls are not redirected, and then not intercepted either... That's why if you do something like that in Spring: @Transactionnal public void doSomething() { doSomethingInNewTransaction(); doSomethingInNewTransaction(); doSomethingInNewTransaction(); } @Transactional

Editing ArrayList of objects with struts 2 form tag

99封情书 提交于 2020-01-27 03:09:46
问题 I have 2 classes - Student and Course . Both have all getters and setters defined on the attributes inside them. Using these two classes I am trying to build a web application with general functions like editing and adding students in different jsp pages. I student could have enrolled in multiple courses and marks for each course of each student should be editable inside the app. Now i have a studentMarks.jsp which loads the data from an action class - StudentAction public class StudentAction

How does one protect a webapp to be accessed only by localhost?

混江龙づ霸主 提交于 2020-01-25 21:09:08
问题 I am planning to run a java web application and solr in the same java container. I want the web application to be publicly accessible but solr to be accessible only to the other web applications in the same container. Solr should be accessible only as localhost and not from outside. Can we write some rules in the web-xml to achieve this? 回答1: This is actually a question for serverfault. Anyway, you can deal with this the same way you deal with any internal server, like a database server: don

Spring WS client set cookie for authentication

帅比萌擦擦* 提交于 2020-01-25 18:40:10
问题 In order to consume a RPC web service, first I have to call a web method 'Authentication' and then I am supposed to be able to call other web methods. I have tried to implement a spring web client to consume this service but something is going terribly wrong. This service was originally designed for php users and the sample client code they provided is as following: $soap = new SoapClient('http://www.2972.ir/wsdl?XML'); if ($soap->Authentication('user', '123456')) { echo $soap->getCredit(); }

OSGI - CDI / is it usable right now ? [Oct 2012]

谁说胖子不能爱 提交于 2020-01-25 15:35:56
问题 I'm quite new to Java EE 6 and OSGI concept, and i'm quite excited about it... The most exciting feature is the dynamic dependancy injection at execution time. I've seen some really great presentation where the application is ajaxly updated when a bundle is activated or unactivated, i like that way of decoupling the application in modules and updated it at run time ... Second though, i'm quite boring about XML configuration files, i think Java EE 6 with javax.inject and others annotations is

OSGI - CDI / is it usable right now ? [Oct 2012]

拟墨画扇 提交于 2020-01-25 15:34:43
问题 I'm quite new to Java EE 6 and OSGI concept, and i'm quite excited about it... The most exciting feature is the dynamic dependancy injection at execution time. I've seen some really great presentation where the application is ajaxly updated when a bundle is activated or unactivated, i like that way of decoupling the application in modules and updated it at run time ... Second though, i'm quite boring about XML configuration files, i think Java EE 6 with javax.inject and others annotations is

Why does the server log that it can not open keystore.jks when I try to create a connection pool?

这一生的挚爱 提交于 2020-01-25 10:17:29
问题 Why am I not able to create a JDBC Connection Pool in GlassFish 5.0? I want connect to MySQL server. I created connection pool by guide, but nothing is working. I used Resource type: java.sql.DataSource Driver class name: com.mysql.cj.jdbc.MysqlDataSource [2018-07-17T15:45:15.500+0300] [glassfish 5.0] [WARNING] [test.connection.pool.failed [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=45 _ThreadName=admin-listener(4)] [timeMillis:

Oracle database object type import in Java

不打扰是莪最后的温柔 提交于 2020-01-25 07:15:24
问题 Is there a way to import oracle defined object type in Java(JPA). I have a complex object defined in database : create or replace TYPE "myType"{ someString varchar2(100), someString2 varchar2(100), constructor....} this object type is than used in a database table. 回答1: There is no standard support for object-types in JPA. If you are using EclipseLink, you can use the @Struct annotation to map object-types, http://www.eclipse.org/eclipselink/documentation/2.5/jpa/extensions/a_struct.htm

How to authenticate and redirect a user to his 'own' page in Jersey REST service

白昼怎懂夜的黑 提交于 2020-01-25 06:04:16
问题 How to authenticate and redirect a user to his own page i.e to www.mysite.com/"user's email". I am using the following algo which is not working... userDB in User class: Map<String,String> userdata=new HashMap<String,String>(); First my login process form : @Path("/login") @POST @Produces(MediaType.TEXT_HTML) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public void login( @FormParam("email") String emailc, @FormParam("password") String pass, @Context HttpServletResponse servletResponse )

How to authenticate and redirect a user to his 'own' page in Jersey REST service

岁酱吖の 提交于 2020-01-25 06:03:06
问题 How to authenticate and redirect a user to his own page i.e to www.mysite.com/"user's email". I am using the following algo which is not working... userDB in User class: Map<String,String> userdata=new HashMap<String,String>(); First my login process form : @Path("/login") @POST @Produces(MediaType.TEXT_HTML) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public void login( @FormParam("email") String emailc, @FormParam("password") String pass, @Context HttpServletResponse servletResponse )