Tim Holloway

Saloon Keeper
+ Follow
since Jun 25, 2001
Merit badge: grant badges
Biography
Long-time moderator for the Tomcat and JavaServer Faces forums. Designer and manager for the mousetech.com enterprise server farm, which runs VMs, a private cloud and a whole raft of Docker containers.
These days, doing a lot of IoT stuff with Arduinos and Raspberry Pi's.
For More
Jacksonville, Florida USA
Cows and Likes
Cows
Total received
In last 30 days
12
Forums and Threads

Recent posts by Tim Holloway

I would have used but that's mainly because that last example is a recent addition to the language and I'm still thinking the old C-style way.

Of course, for a web page, you would generally use a JSP HTML template with EL expressions to plug in the bean values.
1 day ago
First, remove that annoying pipe at the front:

And if you must concatenate by brute force, use a StringBuilder!
1 day ago
The opposite of "split" is "join".

Alternatively, if you just want to replace the "|" with commas, use the String "replace" method.
2 days ago
My learning days were back when pteranadons were learning to fly. These days there's better options.

But when I ran a program and it bombed back then, a "core dump" printed out. A hexadecimal display of the machine state and contents of memory.

The memory displayed included both the actual memory image of my own program, but also that of the libraries that were linked in with it and even parts of the OS itself.

Having little better to do with my time (such as a social life!) I hand-disassembled that code and wrote it down into notebooks, many of which I still keep. That's how I got to look at other people's code. My classmates were more interested in cribbing mine than having anything I could exploit.

Then we got a (Prime) minicomputer and the entire operating system source code came with it, including the system utilities and it was evolving almost in real time, so I also got technical newsletters from the OS developers. Lots of good examples in Prime Macro Assembler and Fortran (a lot of Primos was written in fortran, and the hardware was designed to tun it optimally).

There were other sources. When I got my Amiga computer, I disassembled the OS code for it and you could talk directly to the OS developers at Commodore via CompuServe.

These days we have places like gitHub and open-source projects galore. everything from the Linux kernel to to source for OpenJDK and gcc, oodles of Apache projects and on and on. So the hard part is indeed choosing the examples you want to study.

Definitely you should learn basic JEE (the web stuff), I highly recommend JPA. Learn Spring before Spring Boot, because Spring Boot is Spring with (many) attachments.

And if you have professional aspirations, keep an eye on what local employers are looking for.
2 days ago
Ouch. I haven't done anything that way for a very long time. These days I use an XML or YAML configuration file for my datasource definitions. Which would be something like "applicationContext.xml" or "application.yml" depending on my environment.

An example of a scan path for persistence in a very old webapp of mine in the applicationContext.xml file looks like this:

Note also that for the @Configuration and @Bean annotations to be properly processed you may need to have that class in a scan path as well.

For a Spring Boot app, some of that stuff gets automatically generated for you by the app builder, but for a stand-alone app, you'd have to set it all up yourself depending on the application type.

By the way, I strongly discourage stored procedures except when you have special needs that cannot be handled by ordinary SQL/JPA, but that's another matter.
OK.

Normally we don't want people to edit their posts because it can confuse people who didn't know what the original post said and we'll undo those edits. In your case, as long as it was just something obvious from what was said, I think we can let it go. No point in re-posting all that stuff.

The one thing you didn't supply was the Spring Data config. In order for Spring to manage its data facilities properly you have to tell it which package path(s) to scan looking for entities and repositories. So, for example, I have a scan path for, say, com.mousetech.myapp.persistence and sub-packages for the DAOs, Entities and so forth.

Otherwise Spring would end up having to scan a lot of other packages that have nothing to do with your database and that would waste a lot of time.
For a project of this scale, I'd recommend a pilot system first. Without any real measurements to start with, it's hard to know what to sweat about.

Spring itself is very small. The "gotcha" is that Spring applications -- and that definitely includes Spring Boot apps -- often employ one or more of Spring's add-on modules. As a rule, those modules are also compact and efficient, but what's efficient for most cases isn't necessarily efficient for you, and again, that requires measurement.

Spring Boot apps each contain their own private webapp server, e.g., Tomcat. Tomcat isn't very greedy, but if you have a lot of them, it can add up. A primary benefit of Spring Boot is that you can spin up/down multiple instances in a distributed elastic environment, but if that isn't a good fit for your actual workload, it might be more profitable to install multiple microservices in a Tomcat instance(s) or even look at commercial servers like WebSphere and WebLogic.

Before writing a lot of ETL services, consider the dedicated ETL products such as Hitachi's Pentaho, Available bot in free community editions and with commercial support. They are extremely efficient and can typically be "programmed" by non-programmers.

I definitely recommend JPA over brute-force JDBC. It scales much better both in performance and in maintainability.

4 days ago
Welcome to the Ranch, Akash!

Your sample classes don't have any package definitions in them.  

Paul Clapham wrote:Yes, nobody yet seems to be suggesting using AI for maintenance programming. But then most people are completely unaware that maintenance programming even exists.


The only thing that frightens me more than having AI mindlessly generate code is having it mindlessly maintaining it and all its wierd quirks.
1 week ago
Sorry, I got this thread crossed with the JavaScript error thread. F5 should do the refresh, though. Sometimes Ctrl-R. Or the "circle button, alt-F/R, etc.
Oh.

I think you have the full kit of anti-cache tags and I just noticed the "other window" effect


Now as to the javascript error, again, if you send the code to a pretty-print service, it may help highlight the missing parenthesis problem. I suspect that one line, but that would help to determine more precisely.

Given the anti-cache tags, you should be able to press "F5" and refresh the page. But if the JavaScript is indeed malformed, then that won't fix that part.
This line looks questionable:

But one thing you might want to do is install a JavaScript ediitor plugin and open this file - or create a temporary "file" with that code pasted in, then do a Source/Format menu operation and see how it looks.

If you're just creating a temporary file to try formatting, you can dispose of it once your problem is solved.

Tim Cooke wrote:I'm no web expert, but I think we use workbox in some way for cache management.


I think that's Chrome-specific.

Norm Radder wrote:I used that technique on line 12 with a query string.  It didn't change anything.
I don't know how the browser decides to use cache.  


For Firefox, I think you'll find that option on the about:config page. I can't say offhand for other browsers.

If you're looking to permanently prevent caching for a page on your site and not just for temporary testing, there are several "nocache" meta tags and the like. There was originally no standard so you had to set caching for a page in about 4 different ways if you wanted it to work on all the major browsers.
You can probably adjust your browser's settings to disable caching.

In any event, all the browsers I know of have a one-time "delete" option that typically allows selecting different things to delete, including cookies and cache