java-ee

how to handle composite key hibernate

谁说胖子不能爱 提交于 2019-12-23 05:49:10
问题 My hbm.xml file is like this: <hibernate-mapping> <class name="pojopackage.WordhelperWordusage" table="WORDHELPER_WORDUSAGE" schema="SOZANA"> <composite-id name="id" class="pojopackage.WordhelperWordusageId"> <key-property name="idwh" type="java.lang.Integer"> <column name="IDWH" /> </key-property> <key-property name="idwu" type="java.lang.Integer"> <column name="IDWU" /> </key-property> <key-property name="type" type="java.lang.Integer"> <column name="TYPE" /> </key-property> </composite-id>

Why will a full gc on small heap takes 5 seconds?

牧云@^-^@ 提交于 2019-12-23 05:33:16
问题 I am running an J2EE application on 3 year old Solaris system with a used heap that is about 300 MB. From the gc logs I have seen that the full gc that is triggered a few times a day takes about 5 seconds and recovers about 200 MB every time. What could be the reason for a full gc to take such a long time on such a small heap? I run java 1.6.0_37. 回答1: A slow full GC (and minor GC for that matter) is primary a result of a poor hardware setup and secondly software configuration (i.e. GC

Vehicle Tracking System[java/Java EE]

大兔子大兔子 提交于 2019-12-23 05:27:33
问题 I am interested in building a vehicle tracking system using GPRS. However, I have some questions for anyone who has done this before: Is GPRS the best technology to use? Any problems people are aware of? I am planning on using Java/Java EE - is there any better technologies? If someone has built this before - do you have some examples of what to see for system requirements? What are some good web resources you've found working on this? Is there a step-by-step guide anywhere to getting started

grails 3.0.9 WebSocket 404 error

[亡魂溺海] 提交于 2019-12-23 05:05:06
问题 i am trying to create chat application with grails. i am using grails 3.0.9 and tomcat-8.0.28 Sorry for duplicate i read this question and this... but thats not solve my problem.. i already change javax.websocket-api to provided like this : provided 'javax.websocket:javax.websocket-api:1.0' but i still get this error : Firefox : Firefox can't establish a connection to the server at http://103.56.148.50/chat/chatEndPoint/C001D939F2564251C86E646B9127495D" Chrome : Error during WebSocket

Understanding HttpServletRequest and cookies in JSF

痴心易碎 提交于 2019-12-23 04:53:07
问题 In order to create a "Remember me" login in JSF, I am trying to understand how Cookies work. I have created a brand new Web Application using JSF, with this bean that creates a Cookie expiring with the session: CookieBean class @ManagedBean @ViewScoped public class CookieBean implements Serializable { public void create() { ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext(); ec.addResponseCookie("MyTestCookie", "Hello Cookie", null); } } and index.xhtml has this body:

Populating a drop down list in JSP from a Array List of Bean type

荒凉一梦 提交于 2019-12-23 04:48:13
问题 In my Java EE project I have the following Servlet: import java.io.IOException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import javax.naming.InitialContext; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql

How to distinguish between Known IP and unknown IP

岁酱吖の 提交于 2019-12-23 04:45:57
问题 i need to develop a web application that can identify a known machine and unknown by storing a pair(sourceIP,valid username) at server side for which previous login was successful.when anyone login from unknown machine how can be identified.web app is hosted in local host.is it possible to get the client ip.when retrieving client IP i get only 127.0.0.1 which is localhost.anyone having any idea...? 回答1: The short answer is that you can't always get the real client IP address. If the client

How to run a specific method on a specific date and time?

别说谁变了你拦得住时间么 提交于 2019-12-23 04:45:11
问题 I need to force my java application to perform a couple of actions on a specific date and time. The scenario is as following: 1- user set a specific time and frequency (every day, every month) 2- system starts a trigger for the request 3- once that pre-defined frequency and time are reached 3.1 - system performs the required actions that are kept in a method I have found this answer but could not make it work. An example would be appreciated. 回答1: There are multiple java scheduler frameworks

Local Thread linked with RequestScope

心不动则不痛 提交于 2019-12-23 04:43:47
问题 I have a web service built with VRaptor that uses CDI (weld 2.1.2.Final). I need to parallelize some of the processing made by the server (statistical analysis of industrial alarms). I'm doing that using a ExecutorService and Callable instances, unfortunately I need one Request Scoped dependence inside my Threads. Because of that dependence I'm facing this error: WELD-001303: No active contexts for scope type javax.enterprise.context.RequestScoped Is there a way to link the Threads to the

gzip compression in web server or app server?

删除回忆录丶 提交于 2019-12-23 04:37:40
问题 I'm using Weblogic application server and Apache web server in my J2EE environment and planning to implement gzip compression of response. Not sure, whether to implement compression on the Apache server or on the weblogic. 回答1: Unless you have a very good reason to not do so, you want to put the load of compression on the web servers since the app servers are already busy at doing other things. To use mod_weblogic together with mod_deflate , have a look at this post. 回答2: Depends whether you