This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!

Stephan van Hulst

Saloon Keeper
+ Follow
since Sep 20, 2010
Cologne, Germany
Cows and Likes
Cows
Total received
244
In last 30 days
0
Total given
208
Likes
Total received
2513
Received in last 30 days
62
Total given
362
Given in last 30 days
7
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stephan van Hulst

I mean, what is the literal file name of the built WAR, including the .war extension?
58 minutes ago
The obvious question is, does Transaction override equals(Object) and hashCode()?
1 hour ago

Prasanna Raman wrote:That other function is supposed to find all customer IDs that have spent more than the allocated amount in any 12 hour period (the time argument is in chronological order in the list).


Okay, so you need a sliding window?

First, create a strongly typed representation of your input:

Now, given a stream of expenses, you will want to collect them into windows of a preset duration. A window might look like this:
<br /> Collect your expenses: <br />
Finally, for each customer in the map, iterate over the time windows and if the sum of the monetary amounts of the expenses in a single window exceed your maximum, you'll know too much has been spent.
1 hour ago
What is the name of the built WAR file?

Please show us the contents of the XML files in the spring folder.
6 hours ago
Show us the URL you're browsing to, your web.xml and your context.xml. If you're using annotation based component discovery, show us your main application config class.
6 hours ago
I don't know what your input represents. You need to be very precise in your wording.

Your input is named time, but you're talking about a time period. A time period is an amount of time between two points in time. From the name of your input I can not determine whether it represents an instant in time or an amount of time.

What does the amount input represent? An amount of time? An amount of money? Something else? What is it spent on? How do you determine that you've exceeded the limit?

How do you get the input? From where?
6 hours ago
Google Web Toolkit (GWT) is open source.

I strongly recommend against ANY such tools. The idea is nice, but it will give you more headache than it's worth in the long run. Just write your front-end in a client-side language directly.

If you don't like JSPs, you can write your front-end with JSF Facelets. I'm not a huge fan, but you should definitely try it out before opting for beasts like TeaVM or GWT.
7 hours ago
CarefullyChooseOneForum <-- read this page

It appears you want to write Python, not Java.
7 hours ago
Well there's your problem.

Resources inside the WEB-INF folder are private. A client can not access them by browsing to them directly. Instead of redirecting to those pages, you must forward to them. You do this by returning a view from your method. However, since you're using a @RestController, your methods won't return views; they will return response bodies instead.

You need to make a decision. Do you want your controller to be RESTful or not? If yes, then don't forward to an HTML page. Just return JSON or XML data for the client to process. If no, then replace the @RestController annotation with @Controller, and return the route of the view you want to display.
7 hours ago
Duration works well for this.

You can simply use it like this:
8 hours ago
Maven is really not that hard. Have you read the Maven user guide yet?

Start by making a POM for your product and add dependencies to it. Show us where you got stuck.
11 hours ago
Couldn't you just generate the HTML normally and then 'print' the webpages to PDF?
16 hours ago
If you convert the project to Maven, you can easily add the JEE libraries. Depending on which application container you'll be running the application in, you must add additional runtime dependencies.

For servlets, use jakarta.servlet:jakarta-servlet-api. No need to add runtime dependencies.

Base64.Encoder and Base64.Decoder were added in Java 8. Just use the right import statements and change your code a little.

HttpServletResponse and HttpSession are part of the Jakarta Servlet API. Adding the Maven dependency I told you about earlier should be enough.

org.w3c.domElement does not exist. Do you mean org.w3c.dom.Element?
17 hours ago
What is the absolute URI that you are redirected to, and where under the webapp folder are your views located?
21 hours ago
For object arrays, you can just reverse the comparator, because it will be used for both the recursive part and the iterative part.
1 day ago