Ron McLeod

Marshal
+ Follow
since Feb 12, 2013
Ron likes ...
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
Merit badge: grant badges
For More
Richmond, BC, Canada
Cows and Likes
Cows
Total received
572
In last 30 days
5
Total given
340
Likes
Total received
1231
Received in last 30 days
8
Total given
2635
Given in last 30 days
25
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt

Recent posts by Ron McLeod

Jack Tauson wrote:Hmm, so I would probably keep it as it is if it’s possible or upgrade it with what you mentioned and see how it goes.


I don't know enough to have a good opinion - try both approaches and see what works and what doesn't.
8 hours ago

Anil Philip wrote:

Ron McLeod wrote:I believe that he is talking about this kind of scenario


I don't think so - it is obvious a Float is not an Integer.
I have assigned a Float to a List<Integer>
Please see my code above (repeated below).


output:

[2.0]


Yup - I misunderstood.

In Stephen's example, he is assigning a List<? super Number> to a List<? super Integer>:
But in your example, you are doing the opposite


I believe that he is talking about this kind of scenario:
I'm not familiar with DWR, but it looks like the last (official?) version was org.directwebremoting:dwr:3.0.2-RELEASE dated 11-Dec-2016, and it has references to javax.servlet.http.

org.beangle.jakarta:beangle-jakarta-dwr:3.0.4-RELEASE dated 13-Nov-2020 seems to be a replacement which references jakarta.servlet.http.

The GitHub project for it can be found here.
10 hours ago
The JShell REPL (Read-Evaluate-Print Loop) tool can be helpful when try to understand the behaviour of code like this:
Collections#addAll does not return an updated collection; it returns a boolean indicating if the collection was changed.
Usually you would some kind of connection pool solution, where rather than opening and closing connections to the database, a number of database connections are kept open, and a sharing among different parts of your application (or maybe a group of worker threads in a single part of your application).

Depending on the framework/middleware that you are using, support for connection pooling may already be built-in, and just require configuration to take advantage of it.

Here's a couple of write-ups which might help:
Baeldung: A Simple Guide to Connection Pooling in Java
Progress: JDBC Connection Pooling Tutorial
I have never looked at Stuts before, but I am guessing that it uses convention over configuration, and that at runtime, it using reflection/introspection to try and locate the appropriate class and method to handle the event.

Most likely if you examine the URL of the request which was triggered by clicking on the Cancel button, it will become more clear which method was expected but not found.
2 days ago

Jack Tauson wrote:Since there is no onclick event of the cancel button like it's there for other buttons like onclick="this.form.meth.value='save'" (for example). Please explain if my thinking is incorrect here. I guess I can define an action method for the cancel button and call it like "onclick="this.form.meth.value='cancel'" but I was hoping that unspecified method would take care of it. ...


As you already mentioned, there is no onclick handler defined for the Cancel button.  Is the event bubbling/propagating upwards and being handled by another element?
2 days ago
Yukon switched to permanent daylight savings time 4 years ago.

The Canadian province of BC (where I live), along with Washington and Oregon states are waiting for California to make the switch; afterwards all of north american pacific coast will be using permanent daylight savings time.

Rajat Bhatt wrote:The following code snippet has two terminal operations collect and forEach.


I don't know what the question or answers are, but if your choice of answer is based on forEach being a Stream operator, in this case it isn't; it is actually Iterable#forEach, which is iterating through each element of the list returned by the Collectors#toList collector.

Anil Philip wrote:


There is no need to use System.out.format -- the formatting is performed in the String#formatted method:
1 week ago

Anil Philip wrote:I was wondering. It would be nice to be able to use a text-block as (or in) the format string for format() and also println().


It's not clear (to me) what you are wanting to do, but with a text block, I would do something like this:

1 week ago
I'm sure this is available in the Javadocs somewhere, but this is a good reference for Date and Time Formatting.
1 week ago
The formatting sequence %tD represents the date/time in the format YY/mm/DD.  If you want some different, then you need to build a custom formatting sequence.

For example:

%1$ refers to the first argument,  tY specifies year,  tm specifies month, etc.


1 week ago