Marshall B Thompson

Ranch Hand
+ Follow
since Apr 11, 2002
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 Marshall B Thompson

Why does the following occur? A double can hold these numbers can't it?

source = "1234567890123.1234";
dvalue = Double.parseDouble(source);
result = formatter.format(dvalue);
out.print(source + " = " + result + br);
//gives1234567890123.1234 = 1,234,567,890,123.1233

source = "12345678901234.1234";
dvalue = Double.parseDouble(source);
result = formatter.format(dvalue);
out.print(source + " = " + result + br);
//gives12345678901234.1234 = 12,345,678,901,234.123

source = "123456789012345.1234";
dvalue = Double.parseDouble(source);
result = formatter.format(dvalue);
out.print(source + " = " + result + br);
//gives123456789012345.1234 = 123,456,789,012,345.12
17 years ago
The Spring framework looks like a good deal. Has anyone used it on a large project? I'm wondering about two types of "large". Large being many classes, subsystems,..etc. Does the config become unweildy, not worth the effort? Large meaning scaling to many users in a web app. Who (large scalable site, or large scalable product) already uses Spring? I'm trying to justify training cost to my manager.
This happens with both IE and Firefox as the browser. I've tried several things, none of which solve d the issue: excel is not returned to browser if processing server-side takes more than 60 seconds.

Things I tried:
1. Set response headers first. I set content type, but I can't set content length until I create the spreadsheet (takes 60+ seconds). No luck.
2. add a cookie every 10 seconds or so, hoping that would somehow keep the connection alive. No luck.
3. Saved the excel to server file system before streaming it back to browser, does not solve the time issue.
4. I wrote my own client that connects via http to the url that would return an excel, it has the same 60 second issue.

Elsewhere have seen suggestions that setting content length up front is the way to go. But, I don't know the content length until I spend the 60+ seconds creating the content.

I may have to resort to having the user enter their email address on the web page and mailing the excel to them when it is finished. Most requests take a few seconds, the 60+ second request is an exception.
I have a servlet running under Sun Java Web Server 6.1 that uses the apache POI library to create an excel spreadsheet, then stream it back to the browser . This works fine unless the servlet takes more than 60 seconds to do it's processing. If it takes more than 60 seconds, the excel is never served to the browser. However; I know the servlet finishes successfully with no errors. (I have logging enabled.) I can't find any web server settings or defaults that would seem to control this. Is this a client browser thing? It happens with both IE and FireFox.
Thanks for the link. Four tests - one specific to Websphere. Almost a very useful industry test - except for that one IBM specific one.
I'm not finding any certs on IBM's site that have an ICED acronymn. Anyone have the link to that cert role on their site. I'm trying to figure out where the IBM 486 fits into their bigger certification picture.
Does anyone know the role or roles that the IBM 486 is a part of? I can't seem to find that on their site. I'm trying to decide if I should go for the IBM cert (whatever it is called), or the Sun Architect cert. I've heard that one of the IBM cert's (or roles) includes successful completion of the Sun Java Programmer test - but again, navigating the IBM cert site does not answer my questions.
I got this to work by doing the following:
18 years ago
JSP
I have a servlet in a deployed .war file on Sun Java System Web Server 6.1. I have a JSP that is not deployed in any .war file. How do I forward from the servlet to the JSP. I can't figure out how to obtain a context to the jsp pages in the default webapp which are outside of a .war file.

I see that the jsp .class files are in /opt/sun/web/https-c3qweb1/ClassCache/https-c3qweb1/default-webapp where https-c3qweb1 is the name of our virtual server. There is not an explicit WEBAPP entry for the default webapp in server.xml.

Is it possible to obtain the context of these jsps which are outside of .war files?
18 years ago
JSP
I will be writing a web app that hits an oracle db. I plan to use the oracle oci drivers so that I can use proxy authentication. My web server is the Sun Java System Web Server 6.1, and we use it's internal app server capabilities for our app server. I had planned on manipulating the oracle connection pool directly from java code using the oracle supplied driver and classes. However; I see that I can define a connection pool to my app(web) server. I assume this would let me use JNDI to get my datasource. Big deal. Any other reasons? I'm leaning toward not defining the connection pool to my web server.
How do you specify a .jsp to handle not founds with the Sun One Web Server (6.1)? The admin gui seems to want a path to a file (I'm on unix by the way) or a cgi script. Putting path to jsp causes browser to display the source of the jsp.
19 years ago
JSP
How do you specify a .jsp to handle not founds with sun one web server (6.1)? It seems to want a path to a file (we are running on unix), or a cgi script - from looking at the web server admin gui. I put in the path to my jsp but it displayed the source in the browser - did not run it.
19 years ago
I am creating an MD5 Message Authentication Code to exchange with a third-party application. I need to get the MD5 token for the url string I pass to them. When I use JDK 1.4.2.01 the third-party accepts my security token. However; when I use JDK 1.3.1.09 and the optional JCE 1.2.2, the token is different for the same string, and gets rejected by the third-party.

Here is my 1.4.2 code:




Here is my 1.3.1 code



The byte array produced by the following line:
byte[] digest = mac.doFinal(dataBytes);
is apparantly incorrect with 1.3.1, but okay with 1.4.2.
Can anyone help me with this?
19 years ago
I'd like to find the dates that all the JDK's were released. A thread here from long ago points you to a site that has such a timeline thru the year 2000. (https://coderanch.com/t/370675/java/java/History-Java-Versions) I can't seem to find a comprehensive up-to-date list anywhere. Anyone seen one?
19 years ago
I'm using a SequenceInputStream to read multiple files and merge them together into one file. This is way slow. I'm guessing due to buffering. How do I properly buffer with a SequenceInputStream. My code is below. Note that I'm buffering output, but not input. I tried using s.read(byte[] b, int off, int len) but my output was wacked, I apparantly did not use it properly.

FileOutputStream out = new FileOutputStream(strMergedFilePathAndName);
BufferedOutputStream dest = new BufferedOutputStream(out, m_intBufferSize);

while ((c = s.read()) != -1)
{
out.write(c);
}
s.close();
out.close();
19 years ago