Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

jason thompson

+ Follow
since Nov 26, 2014
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jason thompson

I am always a little disappointed when I post here. Everyone always wants me to post my entire source to figure out my problem, yet nothing else is relevant. I tested all the other components individually.

I will say there was at least some good advice here:

But I have a suggestion: Concentrate on one problem to start with:
Why can't it convert

I suspect that when you work that out, you'll solve the rest.

That is how I figured out my problem. Adding fixes it.

Thanks Winston
6 years ago
I have the following code that returns a bunch of IDs as a String type. Then I separate each ID from the String and pass them to another method to convert it to a name. But only the first ID gets converted while the rest remains as is.

An example of units would be (the number of ID could be different):

This still only converts the first ID to a unit name. Unit names might look like this:

instead I am seeing:

How do I get every ID as a unit name?
6 years ago
Is there a way to get the keySet from an Iterator? I am trying to implement multiple file uploads using apache commons fileupload. I need to get the filenames from all of the files selected and pass them all to add as attachments.

The below works for one attachment at a time:

But of course, I want to be able to iterate over every file selected to add as attachments.
6 years ago
In my java application one region, one team, and 8 user roles are required as defaults. They can be renamed (and should be renamed by the sys admin) or disabled, but shouldn't be deleted. I want to protect them from deletion. Should I used their uuid id value from the database or should I add another attribute such as isDefault, true or false to those default regions, teams, users? What is the best practice?

7 years ago
The uuid's are not too long actually, for example '733217e3-850f-4f2d-9c0d-d33eceb7c86d' is an id generated from postgres uuid-ossp. I was originally going to use these values in a conditional statement, for example:

A user role is like a system account (i.e. user, power user, read only user, sys admin, etc.).

And yes, I inherited this application so I have to work within the already existing design.
7 years ago
Yes, I am using uuid values. So a better question is should I used uuids to protect default user roles that the application depends on or should I add another attribute such as isDefault = t or f?

The default user roles (and their uuids) are statically entered on build. New user accounts with one of the 8 roles get their uuids generated. Hard coding uuids in the application doesn't seem like the right thing to do, but not sure adding another attribute is the best way to prevent the default roles from being deleted.
7 years ago
My application depends on eight default user roles (or account types). They can be renamed or disabled, but should not be deleted. I want to protect them from deletion using their uuid value from the db. How can I pass their uuids into a single variable so I can use that single variable in my conditional statement? If I should use an array, can you give me an example of how I might do this?

7 years ago
Thanks for the quick responses.

So yeah:

Works great and I was going to put this in the servlet, but I need to pass it to the jsp. Not exactly sure how to do that. How do I create a session bean from the above to pass into the jsp? Can anyone point me to a good example.

Thanks again.
7 years ago
I am new to java and this seems like it has to be really simple, but so far I am unsuccessful. I want to create a boolean value if a certain condition is met. I need my application to compare who is logged in to my web app with the value for who created a particular report.

I retrieve the creator of a report in report.getCreatedBy() and I can display the current user with user.getName(). I need my application to determine if the person logged in is the same as the createdBy value and then set isAuthor() = true

Then I want to user the isAuthor true or false to display certain information in my jsp. That part I can handle, just not sure what I am missing / have incorrect from above.

Anyway, thanks in advance.
7 years ago