Jim Atharris

Greenhorn
+ Follow
since Jan 07, 2008
Merit badge: grant badges
For More
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 Jim Atharris

Hello,

We have a toplevel build.xml that essentially calls other projects' build.xml files. And this works just fine. However for each target that ant automatically prints out, I can't tell which project's build.xml it came from. Below I have the following (sample) build.xml for each project. This produces output like:



I like the output that the echo statement does; however, it is unmaintainable/error-prone to have to put the echo statement in each task.

Is there an easier way? Any help would be appreciated.

We're using Ant version: 1.8.1

Thanks,
Jim

13 years ago

Lester Burnham wrote:Well, AspectJ is open source, so the risk (and financial cost) is limited.

But then, the Postgres JDBC driver is open source, too, so you can study -and adapt- it to your heart's content.



Postgres is just an example. Would also like to do this w/ Oracle's JDBC.

But you're right w/ Postgres and it being opensource. I was just reading the DriverManager class registerDriver() and seeing if I can do the following



But then it comes to the method below and it does not get called. So I'm wondering the semantics of DriverManager.registerDriver()

Lester Burnham wrote:You didn't say what it actually is that you wish to accomplish, but maybe AOP (using a library like AspectJ) may help?



One *possible* example for MyCoolConnection would have data members that based on a value may let the close() method get called in the base class. The real reason for this question ot the forum is proprietary business related and I cannot get into detail of it.

I would like to avoid AspectJ as that is introducing a COTS to our code base.

Thanks,Jim
Hello,

I was wondering if it is possible that the DriverManager can instantiate my implementations of those three classes. Each of those classes would extend the Postgres implementation:

public class MyCoolConnection extends org.postgresql.jdbc4.Jdbc4Connection
{
}

public class MyCoolPreparedStatement extends org.postgresql.jdbc4.Jdbc4PreparedStatement
{
}

public class MyCoolResultSet extends org.postgresql.jdbc4.Jdbc4ResultSet
{
}

So any .getClass().getName() on instances of the above class would return MyCool* and not postgres' implementation Jdbo4*.


Any ideas would be great.

Thanks,Jim
Hello,

Does swing offer that type of component out of the box? I'm not sure what it is called (so my subject description is the best I can do) but I've seen these buttons on Microsoft Outlook (create either a new Mail message or Calendar entry). Also I've seen them on Thunderbird.

Attached is from MS Outlook.

We're using JDK 1.6.0_16+ deploying on a Windows or Redhat box.

Thanks,
Jim
13 years ago
Hello All,

I'm new to MySQL and need MySQL's equivalent to the common "test" SQL statement that people use for Oracle:

select * from dual;

Thanks,Jim
Hello,

We're using a SAX parser and currently have a class that extends org.xml.sax.helpers.DefaultHandler.

We've overrode startElement(), endElement(), and characters().

In our characters() method, the current code (a lot of it) considers the invocation of characters() to mean that all of the element's value (the "Hello" in <world>Hello</world) is complete and then goes thru a large if/else-if/else-if/... try/catch(es) statement. Then the endElement() is invoked and more if/else-if/... try/catch(es) statements are executed.

I've read that the semantics of characters() is that it is invoked multiple times if the element's value contains multiple lines and really characters() method should just "buffer" its value. And only once endElement() is called then and only then is the element's value is complete.

Because there is a lot of code, my question is if the default functionality can be overridden in the SAX parser so that characters() is called once irrelevant if the element's value contains multiple lines or not?

We're not running Java (on Windows/Unix) with any special options other than "java -cp . MyParser my_data.xml"

Thanks,Jim
>
You're correct! Thank you very much Piet.


Jim
14 years ago
Thanks again Piet.

I think for the value of "100", since I am in Java, couldn't I put "input.length()" (obviously without quotes). That is assuming the String that I'm doing the regular expression against is assigned to the variable called "input".

Would you agree?

Thanks,Jim
14 years ago
Yes.

After I had sent out the help msg I came across the lookbehind:

here (http://www.regular-expressions.info/lookaround.html)

input.replaceAll("(?<!\\\\)\\*","%");

where input are the strings that I had in my original email.

But like Piet pointed out it doesn't work when the input had \\*. It did not replace that asterisk.

Thanks,Jim
>
14 years ago
Hello,

I need a regular expression for the following statement:

Replace all * with a % but don't replace \* with a %

For example, this string

I*am\*not there but*I\*am here.

would become

I%am\*not there but%I\*am here.

Likewise,

I*am\*not there but*I\\*am here. <--- note the escaped \\

would become

I%am\*not there but%I\\%am here. <--- note the escaped \\

Much thanks, Jim
14 years ago
Hello Albareto,

I believe you miss understood the question. I'm not concerned w/ where I'm implementing the logic. And I know how to read file/dirs/etc from the local filesystem.

Maybe I wasn't clear with my question: how does one get the directory hierarchy from a .war file? For example, reading an image from the local file system is easy; but, when you need to get that image from the .jar/.war file there is intermediate step with respect to (using) the Classloader. The fact that the index.jsp comes from the .war that contains the directory/files/etc hierarchy is what I'm after.

Thanks,
Jim
14 years ago
JSP
Hello,

I'm writing code in my index.jsp file which is in MyCoolWarFile.war deployed on a Glassfish v2 app server running in Windows XP Pro. Contained in this .war file are directories called

my_dir_1/my_subdir_1
my_dir_1/my_subdir_2
my_dir_1/my_subdir_3
.... etc

I'm not going to know what directories/files exist under my_dir_1/my_subdir_X but I do know that I need to get the specific ones under "my_dir_1/my_subdir_X" (meaning the parameter passed into this .jsp will have this value (so its dynamic). The concept that index.jsp knows it is inside MyCoolWarFile.war is known to index.jsp.

My question is: what code can I put in index.jsp to get the directories and their file listings under "my_dir_1/my_subdir_X"?

Thanks,
Jim
14 years ago
JSP
Hello all...

(not sure if I have the correct forum...)

Wanted to know if anyone has come across a tutorial for doing this. We've done the OpenSSO tutorial for protecting a web application and had no problem.

We're following this online document:

http://docs.sun.com/app/docs/doc/820-4803?l=en

However, following from pages 83 to 92 produces the following exception:



Our web app server is Glassfish v2, the opensso is also Glassfish v2 (both on different physical machines).

Any help/direction would be highly appreciated.

Thanks,
Jim
15 years ago
Hello,

I've used IBM's and BEA's portal development environment to produce portlets to be installed into their own portals.

My next task is to use an open source IDE (eclipse ganymede 3.4.1) to produce the (helloworld) portlet and deploy it onto an IBM portal server. Are there any tutorials out there that help walk these steps through?

The other task is to use the open source IDE (eclipse ganymede 3.4.1) to produce the (helloworld) portlet and deploy onto a glassfish portal server. I'll admit that I haven't used Glassfish app-server. Any help with respect to Glassfish/Portal would be very helpful.

Thanks...Jim
15 years ago