Michael Piaser

Ranch Hand
+ Follow
since Jan 12, 2015
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Michael Piaser

the answer that I needed was:

FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.getExternalContext().getSessionMap().put("TOC", "Y");
5 years ago
I am looking for the Java equivalent of $_SESSION['CompanyName']; in PHP

I don't know how to "say" this in Java
5 years ago
This is a little hard to explain but the concept is simple.

I have a java application which when the user clicks on the SUBMIT button, I want to display a pop-up message one time. It could happen that there are user errors on the screen being submitted and if so I want to let the application do its' normal process to force the user to fix the user errors (after the pop-up message is displayed once).

I can get the pop-up to display just as I want. The problem is that the popup displays a second time if there are user errors. If when the pop-up displays, I could set a variable (such as alreadyDisplayed), then I could make the program avoid displaying the pop-up a second time.

What I don't know how to do is how to create such a variable (note that my terminology may be wrong). I want the variable to be session dependent (meaning that each user gets their own copy of alreadyDisplayed).


Any thoughts on how to implement?
5 years ago
I don't know much about these xhtml dialogs. I don't know what they are called nor do I know where any documentation is concerning them. Is this part of JSF? Prime Faces? some other strange thing?

I am trying to maintain a very large system and I have figured much of it out in the last few months. But I don't know how these xhtml files really work. I can add buttons, links etc but this is more of a structural change.

There is a button on the screen called SUBMIT. Right now, when the user clicks SUBMIT, it does the submit function. I want to change the functionality so that when the SUBMIT button is pressed, another form pops up over the existing one and the user can then select YES or NO. If he selects YES, I want to send him to the submit function. If he clicks NO, I want to send him somewhere else.

The SUBMIT button executes Java code so if I could write Java code to bring up the "pop-up" I'd be golden. Right now I am using externalcontext.redirect to display the "popup" but it doesn't really popup - it replaces the existing page instead of popping up over it

I know this question got moved to the Swing forum, but I don't know what Swing is and I suspect this system doesn't use it.
5 years ago
I can see how to do this in an .xhtml file (below) as there is another place where this modal box concept is already used.



I don't know how to make it conditional so when the user clicks the SUBMIT button, it would run my xhtml code. Hence the reason I'm trying to do it in the Java code with externalcontext - because I don't understand the .xhtml enough to know how to do it there.
5 years ago
I need to add code when the SUBMIT button is clicked to bring up a modal form. The code which displays the button is:



this causes the following Java code to execute. the externalcontext.redirect brings up the termsAndConditionsDialogApproval.xhtml but I want it to come up as a modal form (on top of the form with the SUBMIT button) and it has to be addressed by the user.

5 years ago
What I was doing for concatenation was legal. After sticking some system.out.println before and after the assignment statement, I was able to track down that the concatenation actually worked and the failure was downstream from the concatenation.
5 years ago
I am trying to concatenate some strings via: String finalString="(User="+endUserCharge+")"; endUserCharge is a string

I get the following error:

caused by: org.codehaus.jackson.JsonParseException: Unexpected character ('(' (code 40)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: java.io.ByteArrayInputStream@3d9127a9; line: 1, column: 2]
5 years ago
The null pointer rabbit hole still seems wrong. I can compile when I set the option as provided but I can't compile when I set the option as run-time. I think run-time is the correct option to use which means I have to figure out why it won't compile.

The compile error is error: package javax.mail does not exist

there must be something in Eclipse/Maven when javax.mail is not defined but should be. It is obviously listed as a dependency (otherwise I wouldn't be able to set the provided or run-time option)
5 years ago
Thanks - the documentation is a little helpful. It seems to say that if I select run-time, then Java expects the javax.mail to be defined on the jboss server (which it should be since nothing has changed there). If I select provided, it means that javax.mail should be included during the compile process. It has always been set to provided and until recently it worked. So I think I have to go down the rabbit hole and try to figure out the null pointer exception. That is typically a pain in the neck but.....Stay tuned.....
5 years ago
Before I go down the hole of trying to diagnose the null pointer exception, my real question is what does the Scope mean and why do I get a compile error when it is set to run-time. The other programmer was having this same problem and changed the scope to run-time and it fixed it. He does not have the compile error and we can't figure out why I do.
5 years ago
The mail functions are no longer working on my system. I talked to another programmer and he said he also had this problem and fixed it by changing the Scope from Provided to Run-time. Unfortunately this didn't work for me. This was done in the Dependency Properties of the POM file (via Eclipse). The problem I am having is when I change the Scope to run-time, I get a compile error saying that javax.mail is not found. I specified mail-1.4.4.jar in the Java Build Path library which I have in my C:\users\michael\.m2\repository\javax\mail\mail folder.

When I run with the scope of Provided or Compile, the program compiles but I get a NullPointerException

I don't understand how this should work or where to go from here.. Any ideas would be appreciated.
5 years ago
I can't figure out what this error message "Cannot make a static reference to the non-static method getEndUserCharge(long, long, long, long) from the type UpdateUserWS" actually means.

The error is coming from:
5 years ago
Found it - there was a space at the end of the string
5 years ago