Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Thomas Kennedy

Ranch Hand
+ Follow
since Jan 20, 2008
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 Thomas Kennedy

Would anyone like to recommend a book for learning XML schema? I'm a huge fan of Bates and Sierra; the book that comes closest to their style is probably best for me.
(I'm completely new to Struts 1.) I've added my jsps and classes to the project, and modified the struts-config as follows:

but when I open the page I get

org.apache.struts.action.RequestProcessor processMapping Invalid path /providerInquiry was requested

while identical links to other pages in the same place work OK. And my struts-config entry is copied from others that work OK and all the files are in the same places.

It occurred to me to wonder if the jsp were not compiling. (The jsp uses some generics but I added the jdkSourceLevel="15" attribute to the xmi file to handle that.) This doesn't seem like the error I would get in such a case, but is there a way, through the jsp lifecycle, I can confirm it actually is compiling?

I also wondered if there is something wrong with my action class. But it's a copy of one that works fine. Is there anything I should check about that code?

The WebSphere server is 6.1, RAD is 7.something, and every other build done on this machine runs fine, so it's not that we're targeting the wrong version. What else can I check here?
7 years ago
Looking over this again I think most questions could be handled as well with tag files. A given question mat have different text on different forms but I think that can be handled adequately with tags. A completely different skin on the same question is more of an edge case. The boilerplate almost certainly needs transforms, but does not need params.
I have a requirement to do a bunch of enrollment forms in the context of jsp. The same questions appear on many forms, but sometimes with different labels, or different options. So the same question could be marked up with one xsl in form A but another xsl in form B. So I plan to implement each question as an xml file:




The xsl will turn the question into an input, or a checkbox or a textarea and so on.

My jsp will look something like this:

<%@ taglib prefix="c" uri="" %>
<%@ taglib prefix="x" uri="" %>

<title>XYZ enrollment</title>

<div id="part1" class="question">
<c:import url="question_001.xml" var="question_001"/>
<c:import url="question_001.xsl" var="question_001.xsl"/>
<x:transform xml="${question_001}" xslt="${question_001.xsl}"/>

<div id="part2" class="boilerplate">
<c:import url="http://localhost:8080/boilerplate_001.xml" var="boilerplate_001"/>
<c:import url="http://localhost:8080/boilerplate_001.xsl" var="boilerplate_001.xsl"/>
<x:transform xml="${boilerplate_001}" xslt="${boilerplate_001.xsl}"/>

<div id="part3" class="question">
<c:import url="question_002.xml" var="question_002"/>
<c:import url="question_002.xsl" var="question_002.xsl"/>
<x:transform xml="${question_002}" xslt="${question_002.xsl}"/>

<c:import url="question_003.xml" var="question_003"/>
<c:import url="question_003.xsl" var="question_003.xsl"/>
<x:transform xml="${question_003}" xslt="${question_003.xsl}"/>


Response data will be captured in xml columns, so I have the option of exposing existing data through the view as xml, or Strings or lists or whatever.

What I don't know how to do is combine existing response data into the markup in some cases. For input fields that's easy, I can have the transform spit out the markup necessary to retrieve the field value from the view. What I don't understand is how to populate things like checkboxes. For example how can my transform know whether to insert the checked="checked" attribute if, for a <question> whose options are RED BLUE GREEN and whose presentation should be checkbox format, the existing data says the user selected GREEN?
I'm doing a union between two DB2 resultsets I'll call yellow and pink.

key, source
select distinct
key, "yellow" as source
from x

union all

select distinct
key, "pink" as source
from y


The requirement is to omit from pink all those rows where key is in the yellow resultset. (Actually the union is between three resultsets but I have omitted the middle one.) How do I fit the EXCEPT in here?
That's my thinking also. It would be a temporary welcome change of pace and I'd learn some new things but in the long run it would be a blunder. I will have to look outside, or take another job with my current employer in another state. Happily, I'm free to do either one.
7 years ago
I've been working in Java for a while but now we have to switch our back end to .Net. That process will take 2-3 years and will be very painful, and I would rather stay in Java and keep improving in that. Now most of the Java jobs around here are such that I'm not quite qualified for: they're heavily concentrated in one sector and they all want the same skill profile, a profile that I don't quite meet. It's impossible to plug the gaps in my current job, so if I want another, non-remote Java development job I'm going to have to move out of state. So I was looking around on my employer's list of open jobs and I see some remote Java QA jobs. So I could work from home doing QA stuff in the context of Spring, JUnit and Maven, all things I don't know much about (we don't use those in this account).

I would not want a remote developer job. I really need f2f contact with other Java people to learn as fast as possible.

My employer doesn't have any other accounts in this area, so my options are:

1. stay with my employer but move to another state and do Java
2. stay here for a while longer and do remote Java Junit/Maven/etc QA for a year, then leave my employer for another job here

So on the one hand this QA job would let me plug some holes -- Maven especially -- in my background with minimum bother, holes I can't plug in my current job. On the other hand, it's QA work, not development, and I don't want to leave the development role.

Is it bad to take a QA job after doing development in the same field?
7 years ago
Yes it works fine on my local RAD but the response page blows up in our model environment which is the same apart from running on unix.

The tag file is invoked by another file which has a similar c:out tag, so if it were going to blow up I suppose it would have done so there. So I think the error message I'm getting is a red herring.

I've checked the usual log files under /profiles/, SystemErr.log and so on. There's nothing related to the problem. Is there some other location I should be checking?
8 years ago
I am adding jstl and tag files to an app that has neither. I'm getting

Tag 'insert' can't insert page '/content/paResultsContent.jsp'. Check if it exists. For input string: "${fn:length(pacode.value)}"

That jsp it says it cannot insert is included in the response by a Tiles template tag. But the code mentioned in the error occurs in a tag file included by the jsp:

I am using the correct 1.1 taglib directive and the 1.1 jars. We are running WebSphere 6.1, Java 1.5.0_30, JSP 2.0 and Servlet 2.4. It works fine on my local RAD where the only difference I can see is that it's Java 1.5.0.

It does not invoke my error handler page. Is this a compilation problem? Where can I find more information on what is breaking? I can find nothing in the logs.
8 years ago
Given a String like "000864.50", how can I strip off the leading zeros except if it's the last character before the decimal? The strings will always end in a decimal place and two digits.


000756.90 becomes 756.90, and 0000070.50 should become 70.50

It seems like I want to do two things:
1. replace all instances of "00." with "0.", recursively, in case it's all leading zeros, and
2. remove all zeros that occur before a pattern that begins with a non-zero digit and ends with a decimal
8 years ago
Yes, that's right, thank you. For some reason I thought the syntax I was using would bring it all in in one go. Perl does take some getting used to. It's awfully cryptic and not altogether to my liking. Happily, my code is done, tested and working -- I used a loop to bring it in line by line -- and I can move on to other things now.
8 years ago
I'm trying to leave my markup in external files and bring it in like this:

# Read the content for the <head> element into a variable.
my $path = $markup_dir . '/head.htm';
open(FILE, $path) or die "Cannot read file $path: $!";
my $head = <FILE>;
close (FILE);

print $head;

The file contains the entire content for my <head> element. But then I find that my <head> element is not terminated, and in fact contains nothing at all:

<!DOCTYPE html><html><head><body><div id='leftbackground'>...

It seems like it must be having a problem with quoted strings inside the file (all are single-quotes). How do I fix this?
8 years ago
In Java I would use Math.round() to compare the value to itself. So I could step out to a scriptlet but would prefer to avoid that.
8 years ago
Is there anything in the fn library that can perform decision in a robust way? All I can think of is to check if the String representation of the value ends with ".00", and that sounds ugly. BTW does Oracle have a documentation page for EL? Thank you.
8 years ago