java-ee-5

jspx script element on GlassFish v3

南楼画角 提交于 2019-11-29 16:15:52
The .war is served from GlassFish v3. I am trying to include a javascript file from my jspx. <script type="text/javascript" src="/base/interface/Service.js"></script> I get the following in my http response <script src="/base/interface/Service.js" type="text/javascript" /> The problem is that it should include the </script> tag. I believe this is why it works on Chrome, but not on Firefox or IE. Any idea how to force <script></script> Update: Not sure if any of this is pertinent, but here is the beginning of my jspx file <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c=

How do I upgrade an existing enterprise project from Java EE5 to Java EE 6 in Netbeans (6.9)

蓝咒 提交于 2019-11-29 05:12:45
The project has an EJB module & a web module. Changing the server is easy, but I'd like to switch to EJB 3.1 also but I believe I need to change all kind of configuration files since I can't do it from the project properties window(s). Any tips or links do useful documentation will be greatly appreciated. Thank you! Apparently it's not that complicated. It worked for me by modifying the following files: <project-folder> /nbproject/project.properties change the following lines: j2ee.platform=1.5 javac.source=1.5 javac.target=1.5 to j2ee.platform=1.6 javac.source=1.6 javac.target=1.6 Repeat the

How to deploy the same web application twice on WebLogic 11g?

时间秒杀一切 提交于 2019-11-28 13:49:39
We have developed a JEE5 web application (WAR) and running it in production under WebLogic 11g (10.3.5). Now the same application should be deployed as separate applications for different customers (different URLs, different data) on the same WebLogic. I managed the first part by setting different context roots after deployment for each of them. But I have yet to make them use different datasources - and since I want to avoid customer specific builds, the persistence.xml is the same for all applications, thus also the persistence unit name. What is the best setup for this scenario? Am I forced

How to get number of connected users and their role using j_security_check?

眉间皱痕 提交于 2019-11-28 05:08:30
I get the username of the connected user (using j_security_check) this way, through a managed bean: ...... username = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal().getName(); And then display it in a jsf page this way : #{userBean.username} But I figured no way to get the number of connected users and get their role. In other words, I want to display besides the username, the user role and the number of connected users. How can I achieve this!? Thanks in advance for your help! EDIT: I can now get the Role of the connected user, using a namedquery in a managed bean :

How to deploy the same web application twice on WebLogic 11g?

℡╲_俬逩灬. 提交于 2019-11-27 08:01:52
问题 We have developed a JEE5 web application (WAR) and running it in production under WebLogic 11g (10.3.5). Now the same application should be deployed as separate applications for different customers (different URLs, different data) on the same WebLogic. I managed the first part by setting different context roots after deployment for each of them. But I have yet to make them use different datasources - and since I want to avoid customer specific builds, the persistence.xml is the same for all

How to include values from .properties file into web.xml?

狂风中的少年 提交于 2019-11-27 07:31:07
I need to include some values from a file.properties into the WEB-INF/web.xml something like this: <param-name>uploadDirectory</param-name> <param-value>myFile.properties['keyForTheValue']</param-value> I'm currently working with this: JBoss JEE5 You can add this class, that add all properties from your file to JVM. And add this class like context-listener to web.xml public class InitVariables implements ServletContextListener { @Override public void contextDestroyed(final ServletContextEvent event) { } @Override public void contextInitialized(final ServletContextEvent event) { final String

How to get number of connected users and their role using j_security_check?

旧街凉风 提交于 2019-11-27 00:48:40
问题 I get the username of the connected user (using j_security_check) this way, through a managed bean: ...... username = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal().getName(); And then display it in a jsf page this way : #{userBean.username} But I figured no way to get the number of connected users and get their role. In other words, I want to display besides the username, the user role and the number of connected users. How can I achieve this!? Thanks in advance

Servlet Mapping using web.xml

╄→гoц情女王★ 提交于 2019-11-26 15:22:08
I have a confusion regarding the structure of the web.xml for the servlet mapping, I don't have any problem by executing it but I am trying to figure it how why we have such a pattern in the deployment descriptor. <web-app> <servlet> <servlet-name>Servlet1</servlet-name> <servlet-path>foo.Servlet</servlet-path> </servlet> <servlet-mapping> <servlet-name>Servlet1</servlet-name> <url-pattern>/enroll</url-pattern> </servlet-mapping> </web-app> Now as far as my understanding whenever a request is comes for url-pattern "/enroll", servlet container is going to match the servlet-name with the url

How to include values from .properties file into web.xml?

半世苍凉 提交于 2019-11-26 13:21:31
问题 I need to include some values from a file.properties into the WEB-INF/web.xml something like this: <param-name>uploadDirectory</param-name> <param-value>myFile.properties['keyForTheValue']</param-value> I'm currently working with this: JBoss JEE5 回答1: You can add this class, that add all properties from your file to JVM. And add this class like context-listener to web.xml public class InitVariables implements ServletContextListener { @Override public void contextDestroyed(final