Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Don Arnett

Greenhorn
+ Follow
since Feb 05, 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 Don Arnett

fingered it out. In the WEB-INF/web.xml file for each context, add the following
<error-page>
<error-code>
404
</error-code>
<location>
/jsp/errorPage404.jsp
</location>
</error-page>

the file entry (/jsp/errorPage404.jsp) must start with a / and is relative to the context home directory.
17 years ago
JSP
Our system uses apache and tomcat on linux boxes. Does anyone know how to configure tomcat to use a custom 404 error page? I can get a custom page (via apache) when someone enters a bad .html URL, but would like to have a custom page for when someone enters a bad .jsp URL.
THanks
17 years ago
JSP
Thanks for the replies. I'll check out the website extractor. Elsewhere someone mentioned using IE's 'Work offline' capability. I played with it a bit and think that I might be able to get it to work.
I got it to download a chunk of the website and was able to access it off line. The files appear to be stored in the Temporary Internet folder, so the problem may be finding the files.
17 years ago
JSP
We have a website made up of .jsp files rather than .html and would like to put a copy of the site on a CD for sales people to have when they are with clients without internet connections.
I recently spent four hours creating .html files for every page by exporting each page from my browser and running scripts to edit links, etc in the .html files.
Does any one have any better ideas/solutions to this problem (other than the obvious installing of Tomcat on the salesperson's computers)?
Thanks
Don
17 years ago
JSP
Thanks for the reply. My original code used TextField(10). The only way that I can get it to work on some PCs is to add a non-empty string.
I suspect that the offending machines are using an older Java plugin. I'm waiting for responses from the users to verify this.
A question:
Where did you look up the bug reports?
19 years ago
In investigating why an applet that I wrote works on some PCs and not others for my client (all running Win95, Netscape 4.75), I wrote the following simple applet:
import java.applet.*;
import java.awt.*;
public class ibLoginApplet40 extends Applet
{
TextField gtxtUserId;
public void init() {
gtxtUserId = new TextField("",10);
add(gtxtUserId);
}
}
This applet works on some PCs and not others, all of which are running Win95 and using Netscape Communicator 4.75. If I change the TextField constructor to TextField(" ",10), then it works on all of the PCs. On the PCs where if fails, the Java Console messages include:
java.lang.NullPointerException
at java.lang.StringBuffer.append(Compiled Code)
* at netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled Code)
at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
Code)
# Applet ibLoginApplet20 can't init: NEW

My question, most likely for a Netscape guru, is 'what inside Netscape (or the PC) is most likely different that is causing the code to run differently on two similiar PCs?'
The Java Console for both reports 'Java 1.1.5'.
I'd like to know so that I can configure a PC here so I can duplicate the problem. The client is two states away and I can't find a PC here that this code will fail on.
19 years ago
Thanks for the replies. I have verified that the particular computers that my applet doesn't work on don't like it if I create a TextField object with:
TextField(10) or TextField("",10)
If I create it as TextField(" ",10), it works fine.
I've posted a question about this above.
19 years ago
That's cuz IE rulz and Netcrap...
19 years ago
I will try that but it appears to be a StringBuffer call that isn't in my code. I have a version where I removed my two StringBuffer references and get the same error messages.
But, since I can't duplicate the error here, I'm relying on others to perform the test and maybe they aren't doing what I ask them to do.
19 years ago
This message is the last message output to the java console when my applet fails (see previous post). I put this in a separate thread because I wonder if someone might know the answer to this question without being bogged down in the detail of the previous post.
# Applet LoginApplet can't init: NEW
LoginApplet is the name of my applet and obviously it is failing during initialization, but what does the 'NEW' refer to? I don't have 'NEW' anywhere in my code and the only 'new' is the 'new' command for instantiating a new object.
19 years ago
Thanks Stephanie. First time that I've seen those error messages.
19 years ago
I have a fairly simple applet that a customer is trying to use, but it works on some of their PCs and fails to initialize on others. The applet lets the user input a name and password, then encrypts the password and sends the login info back to the server CGI program. At the customer site, all users are running Netscape 4.75 and Win95. I've installed Netscape (I hate NS!) 4.75 on a Win95 computer here but cannot get the applet to fail.
See it here: www.intelebook.net/sabretest
It fails during initialization before it gets to my init() routine. When I set the 'debug' param for the applet, at the point of failure I get the message:
java.lang.NullPointerException
at java.lang.StringBuffer.append(Compiled Code)
My code had only two places that used StringBuffer and I made a version that removed any StringBuffer code and I get the same message.
I'm fairly lost at this point. Any applet experts out there have any insight?
19 years ago
Gee, hate to keep answering my own posts, but...
I finally noticed that it did select/highlight the way I expected if I used tab to move focus into a textfield. If I move the focus by clicking in the field with the mouse, the text did not highlight. But this is how the normal HTML input fields work, so all is ok.
I had to add select(0,0) inside the focusLost() to unselect when the field loses focus and now the text fields work just like they did when they were HTML input fields rather than inside an applet.
19 years ago
I have an applet with two TextFields. When the textfield gains focus I want the contents automatically selected & highlighted. I added a focusListener and focusGained method. In the focusGained method I call selectAll().
public void focusGained(FocusEvent event)
{
TextField tf = (TextField)event.getComponent();
tf.selectAll();
//showStatus("selected = " + tf.getSelectedText());
}
The text is being selected but not highlighted on the screen. I mean that visually I don't see a change. But if I call getSelectedText() and display, all of the text is displayed, therefore it is being selected. But the user can't tell because it is not highlighted.
I've even tryed calling repaint() etc.
Any ideas?
19 years ago
I'm new to applets but have noticed that netcrap is very much less forgiving of HTML errors. For example, if you forget the <form> tag, IE will still display form objects, input fields etc, but netcrap will not. Possibly this unforgivingness carries over to the applet world. Look for some small syntax error that netcrap may be choking on and IE is handling ok.
19 years ago