java-ee

how can i retrieve the msg from HttpServletResponse.sendError

只谈情不闲聊 提交于 2019-12-24 07:09:08
问题 i have two tomcat servers that communicate between them. upon an error at one of the servers i would like to send an error response to the other server. i am sending the error using: resp.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage()); i am catching the response with org.apache.commons.httpclient.httpMethod. my question is how can i retrieve the e.getMessage () that i am adding to the error message? thanks 回答1: You can override the page that is sent by declaring a specific page

How to get the time of Computer and not server Java vaadin

十年热恋 提交于 2019-12-24 07:08:42
问题 Hey how to get the time of the computer and not the server using vaadin because getDate return to me the time of the server but i want the client computer time ?? 回答1: Vaadin has a class called WebBrowser that provides useful information about the client (browser): You can access the current WebBrowser instance for example as follows: public class MyApplication extends Application { @Override public void init() { setMainWindow(new Window()); ApplicationContext context = this.getContext(); if

error installing caldecott

此生再无相见时 提交于 2019-12-24 07:03:58
问题 recently i made web application and want to atatch my database with it ..though i followed steps of doing it but still i am getting error ..i dont know where's problem i did in steps .. please let me know where i am wrong please help me where i am wrong or what i skipped .. thankyou.. 回答1: I had problems install caldecott , i got the ERROR: Error installing caldecott: ERROR: Failed to build gem native extension. "C:/Program Files/ruby-1.9.2/bin/ruby.exe" extconf.rb *** extconf.rb failed ***

Downloading files from Servlets - Chrome warning + how to redirect user after download?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 06:57:05
问题 I have a simple table with downlod file links.. Everything seems to work fine, when I click download, the file is found on the harddrive and served to the user. My problem is, when I inspect chrome I see: Resource interpreted as Document but transferred with MIME type application/octet-stream: "http://localhost:8080/fus-app/myUploadedFiles". Why would it say that? The relevant code I have is: httpServletResponse.setContentType("application/octet-stream"); httpServletResponse.setHeader(

Log4J not really excluded in JBoss EAP6/AS7

无人久伴 提交于 2019-12-24 06:55:11
问题 In jboss-deployment-structure.xml from application war file, I have exclude log4j modules or so <?xml version="1.0" encoding="UTF-8"?> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0"> <deployment> <dependencies> <module name="oracle" /> </dependencies> <exclusions> <module name="org.apache.log4j" /> <module name="org.apache.commons.logging" /> <module name="org.jboss.logging" /> <module name="org.jboss.logging.jul-to-slf4j-stub" /> <module name="org.jboss.logmanager" />

Heartbeat while having a long-lasting request

橙三吉。 提交于 2019-12-24 06:45:09
问题 How can I implement a heartbeat with JSF 1.2, RichFaces 3.x using SEAM 2.x which also works during a long-lasting request executed by an user? Currently, we've got a heartbeat (to avoid session timeout) using <aj4:poll action="#{bean.keepAlive}" ... /> which does not work during long-lasting requests on the server. Using an own eventsQueue="heartbeat" allows that the required heartbeat is sent even while executing a long-term request but leads us into a org.jboss.seam

list applications deployed on glassfish from jsf application

心不动则不痛 提交于 2019-12-24 06:45:03
问题 I have three JSF apps working on glassfish 3.1 opensource edition. One of them is supposed to be monitor app. I need to list deployed applications with their statuses and provide functionality of disabling and enabling them. I know, that there is sth like GlassFish API and I've found some samples, but it's not clear to me and I can't figure out how to use it. Can You please provide me some more detailed tutorial/example? I would be very happy. Thanks in advance! 回答1: How about the RESTful API

JSP Session id changes on every refresh

别等时光非礼了梦想. 提交于 2019-12-24 06:39:49
问题 I am facing a problem that the JSP session ID value changes on every Browser refresh on the development server, but I do not know what is the reason. My JSP sessiontest.jsp: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here </head> <body> <a href=

JPA query returns proxied entities

假如想象 提交于 2019-12-24 06:38:55
问题 Suppose I have 2 entities, EntityA and EntityB. EntityB is @OneToOne related to EntityA: @Entity public class EntityB { @OneToOne(fetch = FetchType.LAZY) private EntityA entA; // other stuff } When I load EntityB from DB, the corresponding EntityA (say entA1 ) is lazy loaded. After that I load EntityA list by List result = entityManager.createQuery("select A from EntityA A") .setFirstResult(start).setMaxResults(end).getResultList(); The result list contains both previously lazy loaded and

primefaces calender: how to set dynamically mindate

…衆ロ難τιáo~ 提交于 2019-12-24 06:38:02
问题 I have two primefaces calender controls.I want that when I select a date from the first calender then next calender mindate should be start from 1st calender's selected date.For instance, I have selected 7/5/2013 then next calender should disable all dates before 8/5/2013 This is what I have tried so far but it is not working <p:calendar id="fromD" value="#{requestController.from}" yearRange="2013:2015" pattern="dd/MM/yyyy" mindate="#{requestController.today}"/> <p:calendar id="toD" value="#