java-ee

Pages being processed are merely left blank half way through on errors/exceptions instead of forwarding to the error page specified in web.xml

那年仲夏 提交于 2019-12-22 04:55:34
问题 In web.xml, I have the following configurations for a global error page. <error-page> <error-code>401</error-code> <location>/WEB-INF/error_pages/GeneralError.xhtml</location> </error-page> <error-page> <error-code>403</error-code> <location>/WEB-INF/error_pages/GeneralError.xhtml</location> </error-page> <error-page> <error-code>404</error-code> <location>/WEB-INF/error_pages/GeneralError.xhtml</location> </error-page> <error-page> <error-code>500</error-code> <location>/WEB-INF/error_pages

Maven vs. Eclipse Project Facets for Java EE 6

笑着哭i 提交于 2019-12-22 04:47:19
问题 I have created Maven projects inside Eclipse with these archetypes: ejb-javaee6 webapp-javaee6 The projects were created without facets. Does it make sense to convert such Maven projects into faceted form? Which facets would be helpful and which ones could cause trouble for a Maven project? Specifically: Would any of the following project facets be in conflict with something that is in the responsibility of Maven? Java JavaScript EJB Module Dynamic Web Module GlassFish Deployment Descriptors

Why web.xml 'context-param' cannot have character [children]?

拈花ヽ惹草 提交于 2019-12-22 04:38:13
问题 I am just curious what happen to this web.xml code where I have this error cvc-complex-type.2.3: Element 'context-param' cannot have character [children], because the type's content type is element-only. in the Eclipse (juno version) Markers view. Here is the code: <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http

Are there any benefits to keeping MaxPermSize small?

核能气质少年 提交于 2019-12-22 04:32:42
问题 Assuming a 64-bit JVM, is there any significant benefit to keeping MaxPermSize small? This is in the context of a Java EE application that is frequently redeployed, and has a classloader leak. As a medium-term workaround, it seems very reasonable to just bump up MaxPermSize to an absurd value - as long as it won't blow out the disk swap space. Because the undeployed app's code is nearly all unused (apart from that involved in the leak), it's paged out by the operating system. So the load on

Are there any benefits to keeping MaxPermSize small?

爱⌒轻易说出口 提交于 2019-12-22 04:32:09
问题 Assuming a 64-bit JVM, is there any significant benefit to keeping MaxPermSize small? This is in the context of a Java EE application that is frequently redeployed, and has a classloader leak. As a medium-term workaround, it seems very reasonable to just bump up MaxPermSize to an absurd value - as long as it won't blow out the disk swap space. Because the undeployed app's code is nearly all unused (apart from that involved in the leak), it's paged out by the operating system. So the load on

Handling Hibernate Transactions

为君一笑 提交于 2019-12-22 04:13:28
问题 Currently I have this code duplicated in each one of my Controller methods: Transaction transaction = HibernateUtil.getSessionFactory().getCurrentSession().getTransaction(); if (!HibernateUtil.getSessionFactory().getCurrentSession().getTransaction().isActive()) { transaction.begin(); } Is this the correct way or is there a better way of doing this, perhaps in a separate class that I can reference? If so, how? Every time I've tried to put it in a separate class and reference it from other

JBoss 7.0.1 running without jsessionid in the URL is not working

风流意气都作罢 提交于 2019-12-22 04:05:25
问题 Because of some security reasons I deceided to disable session tracking by jsessionid in URL. Before I changed my web.xml to the one below, I had on the first time I visited the page a jsessionid in the url, after clicking the first link, it never appeared again. My web.xml looks like <session-config> <session-timeout>10</session-timeout> <cookie-config> <secure>true</secure> </cookie-config> <tracking-mode>COOKIE</tracking-mode> </session-config> Now I have the jsessionid in the URL, if I

@Singleton @Startup @PostConstruct method guaranteed to return before EJBs made available for client calls?

亡梦爱人 提交于 2019-12-22 04:01:39
问题 In the context of a Java EE 6 application run on WebSphere 8.0, I need to execute a number of startup tasks before any business method can be executed. Using a @Startup @Singleton bean for this purpose seems like a promising solution. However, it is not entirely clear to me how exactly the application lifecycle would look like. The EJB 3.1 spec states the following: By default, the container is responsible for deciding when to initialize a Singleton bean instance. However, the bean developer

security flaw - veracode report - crlf injection

混江龙づ霸主 提交于 2019-12-22 04:01:19
问题 I got the veracode report for my javaEE app. It had a flaw at any logging (using log4j), so I add the StringEscapeUtils.escapeJava(log) to all of them, but veracode keeps reporting them as security flaws. Is this a right solution? What else can I do? This is the report info: Title: Improper Output Neutralization for Logs Description: A function call could result in a log forging attack. Writing unsanitized user-supplied data into a log file allows an attacker to forge log entries or inject

How to import Java EE classes to Eclipse? [duplicate]

让人想犯罪 __ 提交于 2019-12-22 03:41:07
问题 This question already has answers here : How do I import the javax.servlet API in my Eclipse project? (15 answers) Closed 3 years ago . I already have installed Java SDK following which, I later also Downloaded Java EE which was not automatically Installed in Eclipse. How do I import the Java EE libraries in Eclipse? 回答1: Download and install/unpack your favorite Java EE container (for web applications use Tomcat) Download and start the Java EE edition of Eclipse In the Server panel create a