James Davidson

Greenhorn
+ Follow
since Oct 14, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by James Davidson

Thanks Bear. I found what I was looking for in the FAQ. What I remember was something similar to the following; I just couldn't find it.

Bauke, I'll look into the <base> element. I am unfamiliar with it Thanks!
16 years ago
JSP
I seem to recall a discussion in this forum some time ago describing a better way to declare URLs in <link> and <script> tags. I believe it described how to declare the URLs relative to the web application root? I have always used relative URLS, e.g. "../css/style.css" simply because it has been easy to do. However, now I have a JSP page that may be invoked via different URL mappings, e.g. /1/2 and /1/2/3. If I use relative URLS, one mapping will not work. My web application folder structure is standard RAD 7 / WebSphere 6, i.e:

WebContent/css
WebContent/js
etc.

Is there a way to declare the CSS links so that they will work for all mappings?
16 years ago
JSP
First, let be clear that I want to execute an EJB on a separate thread, not perform threading within an EJB as I know that violates the spec.

I have a web page that makes a number of relatively expensive EJB calls. Each page requires from 2 to ? calls, each typically from 3 to 7 seconds each. As you can see, this adds up. Some of the data I do not require right away so I have begun creating separate threads to execute some of the EJBs in the background and return their results.

I have actually gotten this to work by:

1. Caching the Home interface.
2. Spinning off a separate thread for each EJB.
3. Creating a Remote object in the thread.
4. Invoking the desired EJB method.
5. Updating the view object for the page from the EJB result.

This allows we to display a page to the user relatively quickly as opposed to waiting from 20 to 30 seconds for all the EJBs to complete.

Are there any potential problems associated with executing an EJB on a separate thread? Everything seems to work as expect it to but I am somewhat leery as I do pretend to be an EJB expert.

Any comments regarding my approach would be appreciated. Thanks!
Is there any way to create a dynamic regular expression? For example, I have the following code:


I would like to use the constant values defined to create the regular expression. Something like: var regexp = / + ACTIVE + /g;

However, this does not work. Any suggestions?
I have created the following example dialog box. It works fine except for one thing: alert("show(1) = "...) displays undefined. Why? Should I not be able to reference the global variable arguments inside the function show()? The init() method is invoked in the onload event. The alert("global = "...) and alert("show(2) = "...) display the value I expect. What am I overlooking?

What is considered the best way to refresh a page or display another URL once a user has completed a requested action via a series of dialog boxes? I have a requirement for an enhancement that requires the user enter responses thru a series of dialog boxes (using showModalDialog). Upon completion, it will be necessary to refresh the invoking page. The refresh will require a trip to the server to obtain new information and I cannot always be sure if the refresh will be for the same page or perhaps a different URL.
Eric,

Thanks for your prompt reply.

Re: "I usually only do it when I am certain that the data stored in the variable/object is a boolean."

Does that mean that, in this case, JavaScript will evaluate the value contained in the object? It seems to me that, in this case, JavaScript would evaluate if (booleanObject) as true regardless of whether the value contained in "booleanObject" is true or false.
What is the proper way to test for a true or false condition in JavaScript? In Java, one would simply code: if (condition) but in JavaScript, it is my understanding that this code tests for existence of a variable, function, etc. Therefore, it would seem to me that the proper way to test for a true or false condition in JavaScript would be to explicitly code: if (condition == true). Is my understanding correct?
Which of the following is correct and can someone explain the difference between undefined and null (with regard to JavaScript variables)?