Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Kev D'Arcy

Ranch Hand
+ Follow
since Jul 26, 2001
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 Kev D'Arcy

Hi,

I', writing a messaging subsystem for an application, and have a requirement to generate XML from beans and vice versa and the 2 technologies I'm investigating are JaxMe2 and XMLBeans from Apache. JaxMe seems to be a closer match to what I'm doing (the XML is relatively small and simple) but my only concern is that the project seems to be inactive (as far as I can tell the last software release was in 2006) and I'm now wondering if XMLBeans is a better choice.

Anyone got any suggestions?

K
So when I'm manipulating values in my code, should I be using the values on the binding component or the values themselves?
9 years ago
JSF
Hi all,

I just have a quick question regard when a value/backing bean should be used over a binding. This is something that there seems to be a lack of clarity over in any of the documentation I've read and seems to cause problems in certain action methods and value change listeners. Typically I use JavaBeans to model my data (lightweight classes that basically have getter/setter methods to hold data) and these are linked via handler classes (which I have set up as managed beans in the faces-config.xml file) to value fields in my JSPs. This all works well on output screens and input forms except in two particular scenarios: a "clear" action to clear the contents of a form and on linked drop down fields (i.e. where the contents of one drop down field determines the contents of another) whose states are maintained by value change listeners. I've found that by manipulating the state of my JavaBeans, these changes are not always reflected in my JSPs because their values seem to be linked to their component bindings.

Can any offer any advice in this area? I should mention that I'm using the Apache Trinidad JSF framework, which seems to have it's own small quirks.

Thanks for any help,

Kev
9 years ago
JSF
Hi Jeanne

How do I write a stored proc that takes a list?

Kev
Hi,

This isn't strictly speaking a Java issue, but I'm writing an application
using stored procedures to access a SQL Server database, and I have a
situation where I need to add multiple rows to a table (it's coming from a
multi-select list box). I'm wondering is there any other way of doing it other
that repeatedly calling the same stored proc to add them one at a time. Since
the values from the multi-select are part of a record, I'd like to be able to
insert/update the record in one go, rather than having to break it up into
multiple steps and then having to write a back-out procedure should any of
the steps fail.

Thanks for you help,

Kev
First of all, I'm going to start with an apology because I know this is probably a very simple thing to do in Maven, I just haven't worked it out...

In building my web applications with Maven (I've just used ant scripts in the past) we have certain config files that change depending on the environment that the application is running in (e.g. log4j files etc). So I need a way of configuring Maven to do this. I've been told profiles are the way to go, but I've never got this successfully working.

My project is set up so that the developer copy of the files are all in src/main resources and the environment specific files are in sub-folders (e.g. src/main/resources/usertest). So when I'm doing the build, I need the files in the usertest folder to replace those in the parent folder.

Any help on this would be greatly appreciated. If I've got my project incorrectly set up, please let me know.

Many thanks,

Kev
9 years ago
Tim,

I'm pretty paranoid too! We (will) have a nightly backup job to back up the repository, but I want my own backup jobs to run as well (very paranoid). It's more to do with being able to restore the repository quickly to another server (i.e. myself) rather than have to wait for a full restore by our server admin. I think I've managed to sort it out thought.

Kev
10 years ago
Hi all,

I currently have a backup cron job running every hour to create a backup
of my code repository. The only issue at the moment is that the backup file
gets over-written each time the job runs.

Is there a way to script the appending of a number onto the file name so
that I can keep say the most recent 50 copies of the file? eg:

backup1.zip
.
.
.
backup50.zip

And when the number hits (say) 50 it'll return to 1?

Many thanks,

Kev
10 years ago
Hi all,

I'm using client certificates as my log in mechanism in my webapp and I'm wondering if there's a way to have the login process redirected to a handler class before it hits a jsp/jsf page. What I need to happen is that once the user has been authenticated and authorised, the roles that the user is assigned to will dictate the contents of a radio button list on the first page that the user sees. The only way I know of doing this is by forwarding the request to a servlet, carrying out the necessary processing and then redirecting the user to the required page.

Is there a neater way of doing this?

Kev
11 years ago
JSF
Yip, needs to be a regex!
11 years ago
If I have a String like below:

me@my.com|ClientId=12345|GUID=klsLDFjlSf09SDf9|KeygenLoc=APPLIANCE|

How can I parse out the Client ID (i.e. the "12345" on its own) value via a regular expression?

Many thanks!
11 years ago
I'm using Suns RI. Radio buttons and drop downs only seem to support Strings.
How do you find MyFaces? It wasn't very stable the last time I used it
11 years ago
JSF
I just have a quick query about form fields and how JSF handles converting
values. From the testing I've done, using primitives in a backing bean and
trying to assign them values from form fields appears to be quite haphazard.
Using text fields or input boxes is quite straight forward and the conversion
and validation seems to work well, but when I start using radio buttons
and drop-down menus, the conversion fails. It seems that only String values
will work from these kinds of input fields, even the wrapper classes
(java.lang.Integer etc) fail. Is this just a know limitation of JSF or am I
doing something stupid....
11 years ago
JSF
Hi,

I just have a query about how to use JSF with roles and URLs restricted
by a security-constraint defined in the web.xml file. In non-JSF land this
is easy to use since the action of the form can be set to a particular URL
and the standard role based URL access will kick in to either allow or
prevent access to it depending on the role of the user.

Since JSF takes this control away from you, I'm now wondering if declarative
role based control is possible in JSF, or is it something that now has to be
done programatically in the code i.e. HttpServletRequest.isUserInRole(). My
hope was to use the declaritive method since it's easier to impliment.

Any thoughts?

Thanks,

Kev
11 years ago
JSF
Hmmmm it seems it's just a "feature" of the WebSphere 5.1 test environment
in Rational Application Developer... And people wonder why I want to use
Eclipse?!

K
11 years ago
JSF