I have a project which has a set of configuration files, where each configuration file represents an environment specific configurations. In other words, I have 3 environments, development, staging, and production. The configuration for each environment is different, e.g. DB name, url etc.
Whenever I want to deploy the same code, on each environment, I have to manually generate environment specific .war file, so that it has environment specific configuration file in it.
What I am looking for is a kind of solution where i have to compile only once in maven and it generates only one .war file, which I can use on every environment. In other words, i want the environment specifi application server/tomcat to identify which configuration to pick.
That way, I'll be sure that we are deploying and testing the same .war file on every environment/application server.
How can i restructure the application to achieve this functionality?
Is it possible to map URL's with independent view dir structure? If so how?
My goal is to simply point an url to a specific view file:
i.e.
[URL] ....
to not/default/path/views/main/index.xhtml and www.myserver.com/application/admin/ to not/default/path/views/admin/index.xhtml
A couple solutions I found so far where:
Solution 1
PrettyFaces
I just didn't wanted to use a third party solution. This is my best solution so far.
Solution 2(a JSF solution):
navigation rule entries in the faces-config.xml file.
A bean is required, not a bad thing in above example but not great in combination with static navigation like:<h:commandButton action="index"/>
Solution 3 (another JSF solution)
Resource Library Contracts This forces me to work in the contracts file.
None of the solutions gave me a clear solution except prettyfaces.
Are there some elegant native JSF solutions ? Something flexible and reusable? Something like a mvc controller i used to use in php applications. In this controller I was able to add a template file in the constructor and an content file in specific function. Custom paths where no problem. I didn't want to use mvc nor the php language in this project.
I have just started learning Java from a local teacher, this teacher said that the Architecture Neutral refers to Hardware while Platform Independent refers to Operating System, but I found a link to a White Paper by James Gosling. The chapter 4 of this White Paper mentions about both binary code format that is independent of hardware architecture and operating system interfaces, but the main point to be noted is that he has put both under the heading Architecture Neutral. Does it mean that the original buzz word is Architecture Neutral, which includes both hardware and operating system independence?
I Have one query regarding OTP, In my project while registration the otp should be generate and send to the mobile number of user which is registered the form.
I am new in this programming language, java. I have a problem after I set my path ";C:Program Files (x86)Javajdk1.7.0_51in". I made a simple program but an error occurred. Here's the screenshot.....
The problem you have is that it doesn't produce a 4x4 array. For that you need more nested for loops.This is what I have tried so far:
import java.util.Scanner; import java.util.Random; public class challenged2e { static Scanner console = new Scanner(System.in); public static int i=0; public static void main (String args[])
[code]...
I get 21 errors and they all have to do with i and j.
I am generating pdf and displaying it in separate window/tab using the approach described in BalusC Code: PDF handling.I need to display blockui ajax loader when i select the commandlink to display pdf.The pdf gets generated but the ajax loader image remains as it is.I need to manually refresh the page to hide it.Is there any way using which it can be hidden as soon as the pdf gets displayed.My code snippet is as below
I want to do a Registration page on some website. i connected to mysql and creating some id like 1 and 2 like this , but i don't want like this. i want to generate v21001 and v21002 to generate on every registration.
Can we use EJB @Asynchronous annotation in distribute environment. I know we can use it but I want to know its Advisable or not. Because It's not advisable to manage user thread in Distribute environment like EJB container .Earlier if we want to make Asyn call then we use JMS. But now they added @Asynchronous annotation with Future Class to achieve the same result.
I want to generate a new tile every 1,5,10,15 (please check the code to gain an understanding of where I'm going) the session last for 4m :20 sec, I need using the date package, I tried using the sleep method however I don't want to pause the whole thread, so I need setting up the time aspect of the key generation (assume all other code works).
Java Code:
import info.gridworld.actor.*; import info.gridworld.grid.*; import java.awt.*; import java.util.*; //importations, just in case you were wondering //locations and actor world are set up //assume all other code works
[Code] ....
I'm using grid world to set up the locations, the tiles are actors that move south every turn
I am developing an inhouse project in my organization. I unable to implement the pdf uploading, downloading, report generation logic as i am totally new to this implementation.
I am having a doubt about how to fix and what could be the code to generate a retroActive salary case in payroll generation. Upto last year(2013) it was working fine.Now it is 2014 and i am stuck as i am new to java.
The system is computing every value in yearly basis,but the inputs are in monthly basis.
map1 is hashmap which contains the destination ip adress When i run the above code the exit code for process (pr) is 1 and hence the tshark command is not executing properly.
While executing my application i came across with this unexpected error which i don't know why?
# # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007fdcacd79a9, pid=4980, tid=7724 # # JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18) # Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode windows-amd64 compressed oops) # Problematic frame: # C [ntdll.dll+0x79a9] # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # If you would like to submit a bug report, please visit: [URL} ..... # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. #
I am writing a payroll program .The program generates random PPS numbers and then takes in users information and calculates the salary accordingly. I am using netbeans and my code is showing errors on line 18 and 42 ("cannot find symbol")on the code for grossPay(). The program seems to crash after a new PPS number is generated and will not run.
package sd_assg_2; import java.util.Arrays; import java.util.Random; import javax.swing.JOptionPane; public class SD_ASSG_2 { public static void main(String[] args) { String[] newPPs = getPPSno();
I was having trouble running some Java programs (not my own) in Windows XP, and in the process I uninstalled and installed JRE versions 6, 7, and 8, one at a time, probably in the order 7, 8, 7, 6, 7. The program that had the original problem only worked in V6, but some other programs stopped working. I went back to V7, and those other programs still didn't work. The message was "the registry refers to a nonexistent java runtime environment installation". The only advice I could find with Web searches was to reinstall the JRE. Needless to say, that didn't work.
So I looked at the registry, and I found that there were still references to V8, which had been uninstalled. The first was
So, there is a bug in the installer(s): if you uninstall V8 and install V7, the 'CurrentVersion' isn't set correctly, with the result that the registry points to a non-existent folder. The V8 uninstallation should delete these entries, or the V7 installation should change them.
I have a task of returning US holiday based on the given date and this utility will be used in a multi thread environment. I have written as below, how to know if my code breaks at any given point by multiple threads
I tried to test this with few concurrent threads, and noticed that the DB call is made for the very first time or when the year being requested is not same as the cached year. But I wanted to see, if this is properly synchronizing and would not fail in any case. My intention is to make a singleton HolidayCalendar, and also synchronized well enough so that every thread using this class gets the required data without blocking each other.
why exactly this isn't printing out the correct way.I'm supposed to print out 100 elements from an array but assign them random integers between 0 and 9.I've tried troubleshooting the issue and when I do it seems i'm only getting one element assigned.
public class Exercise_6_7{ public static void main(String[] args){ int[] counts = new int[100]; for(int i=0; i<counts.length; i++){ counts[i] = (int)(Math.random()*10);
When I click on "Clean and Build" NetBeans generates a .jar file and inside the folder "dist" it add a directory called "lib" with all the java libraries used to implement the program. I would like to achieve with this IDE an unique .jar file that includes everything you need such as Eclipse does by default. Is it possible?
I am coding a game and I am trying to implement a pause and unpause button. in the BoardPanel class I've added the button's 'p' and 'o' to game.wait() and game.notify() (main code is in game class). however the game.wait is having issues and even if i throw interrupted exception or try/catch it doesn't work. I'd like to code it to a single button if at all possible.
Is there a way to multiply two single arrays in which the corresponding iteration from one array multiplies with the corresponding iteration from the second array. For example say you have array1[] and array2[]. Each array has a length of 5. Is there a way to multiply array1[0] by array2[0] and array1[1] by array2[1] and so on.... without having to actually write out the equation of array1[0] + array2[0] = someValue for all iterations of the two arrays?