• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting the document base from an Applet  RSS feed

 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep getting a null pointer exception when I run the foolowing code from my applet


Can Anyone please advice me on what I could be doing wrong. THanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When do you get the Exception - during "this.getDocumentBase()" or during "new URL(...)"?

The javadocs say that getDocumentBase returns the full URL, including the HTML filename, and that during "new URL" the "spec" parameter is appended to the "context" parameter if it is not absolute (which yours isn't), so you likely are constructing an invalid URL.

Just curious: Do you really have a servlet configured to listen to requests into the applet directory?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!