jakarta-ee

Maven doesn't compile webapp

北慕城南 提交于 2020-01-14 05:53:27
问题 Before I made a simple dynamic web project with websockets and without maven, it works fine. Now I try to use maven. But when I'm compiling my project with mvn compile jetty:run it doesn't build with javax.servlet.UnavailableException: Servlet class com.example.testbattle.ServerSide is not a javax.servlet.Servlet exception. It requires to implement Servlet interface. Why didn't I need it with simple dynamic web project. How could I avoid this problem? UPDATE : I have found out the problem it

identify client machine Operating System by using request object in java web applications [duplicate]

最后都变了- 提交于 2020-01-14 05:02:40
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How can I get client infomation such as OS and browser i want to know clients machine Operating system name when i received request in my servlet through request object thanks in advance 回答1: Example using the user-agent-utils library: public class SomeServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String

How to write main() using CDI in Java EE?

时光总嘲笑我的痴心妄想 提交于 2020-01-14 04:24:34
问题 I have a no-client application that I wish to run. It will have no clients but it will make HTTP calls and act as client for other services. It would run for perhaps a few hours or days (but it will not require periodic runs -- just one-shot). I want to run it in a Java EE 7 container, because of the benefits of standard Context Dependency Injection (CD), and a standard JAX-RS client (new since Java EE 7). It is also nice to have services such as JMS, JPA. The question is how do I write /

How to fix hibernate.transaction.flush_before_completion issue with JTA transactions in JBOSS EAP 7.2?

左心房为你撑大大i 提交于 2020-01-14 04:04:27
问题 We have recently migrated from JBOSS EAP 6.4 (JEE 6) to JBOSS EAP 7.2 (JEE 8). In the new version of EAP we are facing issues with the CMT transactions. The flush is not working until we explicitly add the method call entityManager.flush(). The same configuration was working fine in the old EAP server. The new version of container is not flushing the SQL queries during the commit of the transaction. We have setup the following properties in the persistence.xml. <persistence-unit name="ACCOUNT

How to lookup EJB using JNDI in WebSphere Liberty

≡放荡痞女 提交于 2020-01-14 03:18:06
问题 I am trying to perform a JNDI name search using Liberty Application Server.However, It is throwing me a dependency injection issue.Attached is my code I am getting the following Error: [ERROR ] SRVE0319E: For the [com.airline.controllers.FlightDetails] servlet, com.airline.controllers.FlightDetails servlet class was found, but a resource injection failure has occurred. CWNEN0030E: The server was unable to obtain an object instance for the java:comp/env/com.airline.controllers.FlightDetails

Apache in front of JSF

帅比萌擦擦* 提交于 2020-01-13 20:41:27
问题 In Jboss AS 7: Putting Apache in front of Jboss with this works fine: ProxyPass / http://localhost:8080 ProxyPassReverse / http://localhost:8080 So app is accessed by domain.com/app . Problem appears when aiming for a clearer URL(Just domain.com ): ProxyPass / http://localhost:8080/app ProxyPassReverse / http://localhost:8080/app All javax.faces.resource are not delivered in the second case, because they don't use the war context URL. Any idea how to get the faces resources in the second case

Develop in Memory Object Cache

帅比萌擦擦* 提交于 2020-01-13 19:06:34
问题 I am working on a web-based medical application and need to create a small in-memory object cache. Here is my use-case. We need to show list of requests submitted by people who need certain things (Blood, Kidney, etc.) and it's not going to be a huge list as in a given day request for blood or anything else will be a limited one. Please take into account that we do not want to use any caching API as it would be an overkill. The idea is to create a Map and place it in the ApplicationContext.

Develop in Memory Object Cache

三世轮回 提交于 2020-01-13 19:06:14
问题 I am working on a web-based medical application and need to create a small in-memory object cache. Here is my use-case. We need to show list of requests submitted by people who need certain things (Blood, Kidney, etc.) and it's not going to be a huge list as in a given day request for blood or anything else will be a limited one. Please take into account that we do not want to use any caching API as it would be an overkill. The idea is to create a Map and place it in the ApplicationContext.

programmatically retrieve security constraints from web.xml

时光怂恿深爱的人放手 提交于 2020-01-13 18:17:28
问题 Is there any possiblity to obtain the list of constraints from web.xml ? <security-constraint> <web-resource-collection> <web-resource-name>admin</web-resource-name> <url-pattern>/admin/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>admin</role-name> </auth-constraint> </security-constraint> Even better is there a programmatic way to add new constraints ? Thanks, Victor 回答1: If you have a ServletContainerInitializer , in its onStartup() method, you would basically do

Disable Struts converting HTML tags into entities

时间秒杀一切 提交于 2020-01-13 17:16:50
问题 Hi I'm using Struts 1.2 and I installed TinyMCE. The problem is that struts is converting all HTML tags into entities. How do I disable or configure this to allow only selected tags? 回答1: Use the filter parameter (taglib). <bean:write name="someField" filter="false"/> 回答2: Thanks, I was looking for this but in Struts 2, and this helped, it's similar: <s:property value="variable" escape="false" /> 来源: https://stackoverflow.com/questions/716922/disable-struts-converting-html-tags-into-entities