Josh Johnson

Greenhorn
+ Follow
since Jan 15, 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 Josh Johnson

I have a Web Start application that is running out of memory for certain users.
I would like for these users to run the application with hprof turned on so I can figure out what part of the code is using so much memory.
Is there a way I can specify in the jnlp file to run the app with the
-Xhrunhprof option?
18 years ago
Does anyone know how to find out if a user has been inactive (no mouse activity or keyboard activity) in a Swing application for a certain period of time?
19 years ago
I'm not sure why the browser was just displaying the text of the generated jnlp file.
In any case, I fixed the problem by removing the href attribute in the jnlp element. Now it works like a dream.
19 years ago
I have a jsp that generates a jnlp file.
When I point my browser to the jsp, it just displays the xml that the jsp generated. It does not start the Java Web Start application.
What am i missing here?
19 years ago
I need an editable JComboBox that reduces its list of options as a user types in text. If you type "blah" into the textfield of the JComboBox, it will drop down its list and display only those list items that begin with "blah". I want something that works like the Address (URL) textfield in Internet Explorer.
Does anyone know where I can find code that does this?
20 years ago
It appears that the problem I was having was somehow caused by Tomcat.
I just moved the web app to iPlanet, and this problem does not occur anymore. Now sessions created by the troublesome servlet are seen by other servlets and jsp pages.
20 years ago

In a web application I am working on, I have a servlet that can't seem to communicate with other servlets and JSP pages. There are 3 strange things happening.
1) If this servlet stores something in the Session, other servlets don't get that same session when they do a getSession().
2) If this servlet stores an attribute in the servlet context, other servlets can't see that attribute.
3) If this servlet instantiates a Singleton object (that all servlets are meant to share; ex: ConnectionPool), other servlets instantiate a whole new instance when they call getInstance() at a later time.
All the other servlets/JSPs share the ServletContext and Singleton objects. So this servlet looks like it runs in a separate JVM or is considered to be part of a separate web application. I just can't figure out why.
Tomcat is the servlet container we are using.
Any ideas?
20 years ago
Is there any way to determine how busy the machine you are running on is? Is there a way to find out how much free memory the machine has or how many cpu cycles are not idle?
Thanks.
Josh
20 years ago
We are using the free Sun JDBC-ODBC bridge to access a SQL Server 2000 ODBC data source. The bridge is used by servlets running under JRun. JRun crashes sometimes when database queries are executed.
We have downloaded and installed a trial version of a commercial JDBC driver for SQL Server 2000 and we do not have this problem (JRun crashing.)
Has anyone else had this problem with the ODBC bridge and JRun? Did you find a way to fix it?
We don't have the funds to purchase the commercial driver, so we want to try to get this to work with the bridge.
sun.jdbc.odbc.JdbcOdbcDriver is in rt.jar. You need rt.jar in your class path. It comes with the Java SDK.
Does anyone know if there is a free JDBC driver for SQL Server 7 or 2000?
I have encountered the exact same problem that you are having with a web application that I worked on. Here is the way I handled the situation, but this does not really solve the problem.
When it has been determined that the user has not logged in (or that the session has timed out.) I redirected the user to a simple html page that said:

"You have not logged in or your session has timed out.
Click here to go to the login page."
This message appeared within the content frame. The link in this page (that pointed to the login page) specified the entire browser window (or "top" frame) as its target. So when the user clicked on the link to the login page, the login page was displayed in the entire browser window.
I far as I know (and I'm no expert), once the user clicks on a link within a frame, there is no way to make the server's response appear in a frame other than the frame determined by the target attribute (or lack of a target attribute) in the a href tag. I don't know of any way the server can dynamically control which frame it's response it displayed in.
[This message has been edited by Josh Johnson (edited April 30, 2001).]
[This message has been edited by Josh Johnson (edited April 30, 2001).]
21 years ago
Tony's solution is working for me after all.
I goofed. I wrote a little test servlet to show me the value of referer. I would access that servlet my typing the url for the servlet directly into the browser. I was not getting to the servlet by clicking on a link in another page. So the reason request.getHeader("referer") was returning null was because there was no refering url to return!!
Thanks for your help Tony and Frank.
21 years ago
Thanks for the help.
Unfortunately, that didn't work for me. request.getHeader("referer") returns null. I called request.getHeaderNames to look at the list of header names and referer was not listed. But I think that it should be. Isn't that a standard http request header?
I can only think of two places where the problem may be.
1) Jrun: jrun is my servlet engine and maybe it's getHeader method is not giving me access to the referer header. I don't know why jrun would let me see other headers but not referer.
2) Internet Explorer 5: IE is the browser I am using. Maybe it is simply not including the referer header in its request.
Any ideas?
21 years ago