jakarta-ee

Java Servlet HttpResponse contentLenght Header

邮差的信 提交于 2020-01-24 20:07:12
问题 What happen if I do not specify the contentLenght header when I send a HttpResponse containing a zip file. I did some tests and it seems that the header is set by default with the correct file lenght. Can I be sure that this always happens. When I can found some documentation about? this is the most important part of the code: response.setContentType("application/zip"); response.addHeader("Content-disposition", "attachment; filename=" + zipFileName); zos.close(); out.close(); response

professional usage of abstract class for translation

谁都会走 提交于 2020-01-24 12:27:06
问题 the code below is not giving me the answer i want, i don't know where is the problem? FR is the translation of EN (exactly like .properties file) i want to read the translation from the FR.java file if i want to reach the hello variable of fr.java or en.java from the index.jsp page. but code i wrote gives me the value from Lang.java String language = "FR"; the condition is in the .jsp file jdk 1.4 gives me this error :Error(23,23): variable lang might not have been initialized any body can

Spring Security - 'global-method-security' does not work

别来无恙 提交于 2020-01-24 12:12:49
问题 I am a newbie regarding Spring & Spring Security Frameworks and trying to secure a Java EE 7 REST App running on latest stable Glassfish build using Spring Security v3.1.4. Everything is fine but i cannot manage to make 'global-method-security' work ! Here are my configs, any help would be greatly appreciated. web.xml: <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/*.xml </param-value> </context-param> <filter> <filter-name>filterChainProxy<

Spring Security - 'global-method-security' does not work

匆匆过客 提交于 2020-01-24 12:12:07
问题 I am a newbie regarding Spring & Spring Security Frameworks and trying to secure a Java EE 7 REST App running on latest stable Glassfish build using Spring Security v3.1.4. Everything is fine but i cannot manage to make 'global-method-security' work ! Here are my configs, any help would be greatly appreciated. web.xml: <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/*.xml </param-value> </context-param> <filter> <filter-name>filterChainProxy<

java.io.FileNotFoundException: File configuration.yml not found

烈酒焚心 提交于 2020-01-24 10:24:09
问题 I have build a jar file of classes and configuration files. The configuration.yml file is located in root of the jar. When I try to run the application using the following command: java -jar target/drop-wizard-0.0.1-SNAPSHOT.jar server configuration.yml I get the exception below. How can I specify file located in jar from command prompt? Exception in thread "main" java.io.FileNotFoundException: File configuration.yml not found <br> at io.dropwizard.configuration

How to set Context.INITIAL_CONTEXT_FACTORY? NoInitialContextException?

流过昼夜 提交于 2020-01-24 09:44:27
问题 I am new to JMS and the Websphere server and I am trying to access a JMS queue configured on Websphere Application Server 8 from my Java code. I am not able to understand exactly what value should be set for Context.INITIAL_CONTEXT_FACTORY. Should it be the fully qualified class name of the class or something specific to the application server? Hashtable environment = new Hashtable(); environment.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");

Glassfish 5 ignores JAXB @XmlJavaTypeAdapter annotation?

谁说胖子不能爱 提交于 2020-01-24 09:06:32
问题 I just switched to Glassfish 5 from Glassfish 4 and I noticed that Glassfish no longer called the unmarshal method of my DateTimeAdapter class, it worked okay in Glassfish 4. The Web service class receives a json data and it should be converted automatically to the appropriate RegisterItemDTO object. I've tried putting the annotation on the getter method and it still didn't work. The unmarshal method was never called. I've made sure the json data was in the right format. Service class:

Glassfish 5 ignores JAXB @XmlJavaTypeAdapter annotation?

核能气质少年 提交于 2020-01-24 09:05:49
问题 I just switched to Glassfish 5 from Glassfish 4 and I noticed that Glassfish no longer called the unmarshal method of my DateTimeAdapter class, it worked okay in Glassfish 4. The Web service class receives a json data and it should be converted automatically to the appropriate RegisterItemDTO object. I've tried putting the annotation on the getter method and it still didn't work. The unmarshal method was never called. I've made sure the json data was in the right format. Service class:

Multiple applications in single Tomcat vs multiple instances of tomcat

夙愿已清 提交于 2020-01-24 05:37:04
问题 Currently, we run multiple applications in a single Tomcat I would rather run each application as a single application with embedded Tomcat Does anyone see any downside to this ? I am guessing my per instance need for Memory will go down- so my over-all memory consumption will basically remain the same. Am I missing something ? 回答1: I think you will need more memory overall as each application will need to have its breathing space. You will also probably have to do more maintenance as the

Maven not using the local repo

隐身守侯 提交于 2020-01-24 02:44:26
问题 I'm using maven without m2e, my mvn install is failing because a plugin is not available anymore on maven central. I'm working with an old pom.xml dating from 2008 and must uses maven-cdk-plugin version 3.3.3.Final. Since it was not available anymore I took it on someone else computer and putted it in my .m2 local repo. .m2\org\richfaces\cdk\maven-cdk-plugin\3.3.3.Final however I'm still getting this error. [ERROR] Plugin org.richfaces.cdk:maven-cdk-plugin:3.3.3.Final or one of its depe