Skip to content
Advertisement

Tag: jakarta-ee

How to activate my own Jakarta HttpAuthenticationMechanism implementation in Jakarta EE app

I am creating an simple Jakarta EE 9 app. Because of my own reason, I have to implement my own HttpAuthenticationMechanism (I am not using built-in HttpAuthenticationMechanism CDI beans). I am having an issue with activating my own HttpAuthenticationMechanism. In my login servlet, I try to call SecurityContext.authenticate(request, response, AuthenticationParameters) to process a login manually, but my own HttpAuthenticationMechanism never

Is there an elegant way to exit ClientRequestFilter?

I implemented a ClientRequestFilter. But one call of a client should not be filtered, which means if the request comes from this class (in my case the class is called TokenClient) the method should just return. Right now as you can see I check the path and if it contains /token it will return. But I would rather check if

What is the name of the design pattern where I dynamically pick the correct implementation based on data?

Originally I picked the correct User implementation, based on domain and realm data from the Java EE server. However that was company code, so I had to rewrite the example with numbers. I hope the underlying pattern is still understandable though. For those unfamiliar with CDI, @Inject Instance allows you to iterate through all implementations of an interface. Answer I

OpenLiberty JakartaEE 9: access TransactionManager

On Docker Image open-liberty:22.0.0.1-full-java17-openj9 with the following activated features: and the javax namespace, it was possible to create an TransactionManager via the api dependency in the following way: We are moving to JakartaEE9 and this one API dependency seems not to have an equivalent for the jakarta.* namespace, so that this is not compiling: In the openliberty zip, see https://repo1.maven.org/maven2/io/openliberty/openliberty-runtime/22.0.0.1/openliberty-runtime-22.0.0.1.zip

Session created by Tomcat

I am learning session with servlets and i read in the book that to create a session we need to call as below. HttpSession session = request.getSession() This causes the web container to create a session ID and send it back to client so that client can attach it with every subsequent request to the server. When i open developer

Getting javax.servlet.ServletException: javax.naming.NamingException: Lookup failed for ‘java:global/ShoppingCart-1.0-SNAPSHOT/ShoppingCartRemote’

I am new to JAVA EE. I am trying to implement stateful session Bean via IntelliJ IDEA and glassfish server 4.0 while running the code getting below exception. Attaching the code and glassfish configuration as well. Error is coming as the lookup has been failed. Can anyone help regarding the lookup? Glassfish Configuration Remote Interface Stateful Session Bean JSP Code

How to unit test methods together with its constraint validators (which some should be mocked out)?

My app has a service layer which is composed by CDI applications scoped beans: When a method gets called, an interceptor (in my case BValInterceptor.class from Apache BVal) checks if the method contract is respected by checking the annotations and validating the parameters accordingly. As you can see, there are some custom constraints like @SectionExists, @PostExists that may hit the

Advertisement