No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I'm trying to run a simple servlet that counts the number of times a user visits the page using cookies but I'm getting the following error. I thought that NullPointerException was because there were no cookies at all in the browser. But after checking I found a couple of cookies … |
|
Even after setting all the paths correctly, I get an error saying the "setclasspath.sh" cannot be found. I checked the directory and it was there. I then changed the permissions using chmod +x setclasspath.sh but to no avail. I've changed the permissions of all the files inside the "bin" directory … |
|
System Information: OS: Ubuntu 11.10 Server: Tomcat 7.0 JVM: openjdk 1.6 I have checked if the server is running by going to [url]http://localhost:8080[/url]. It's working fine. I just need to know the directory in which I should save my servlet in order to run it. I think I am supposed … |
|
So, I wrote the following program to connect to my local mysql server and create a table in the existing "test" database. The program compiled without any errors, but I got the following run-time error: java.sql.SQLException: Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on … |
|
I have created a window containing only one button(park1). All I need is a new dialog(with "OK" and "Cancel" buttons to open when I click on park1. Thanks in advance. [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; class MyWin extends JFrame implements ActionListener { JButton park1; MyWin() { setSize(450, 500); … |
|
So I know of two methods of reading or writing files in java. The first is the read(byte[]) method provided by InputStream class. The second is the readLine or write() method provide by the Buffered prototype. Which is the more efficient one out of these? Which one would you recommend? |
|
OpenDNS tracert results: C:\>tracert -d 208.67.222.222 Tracing route to 208.67.222.222 over a maximum of 30 hops 1 <1 ms <1 ms <1 ms 192.168.1.1 2 36 ms 40 ms 39 ms 117.195.32.1 3 35 ms 35 ms 38 ms 218.248.164.38 4 41 ms 39 ms 41 ms 218.248.255.86 5 41 … |
|
[CODE]class MyThread1 implements Runnable { Thread t; MyThread1() { t = new Thread(this);//create a Thread t.start();//activate the thread } public void run() //override run() of Runnable { int i; for(i =0; i< 1000; i++) System.out.print("*"); } public static void main(String args[]) { MyThread1 m1 = new MyThread1(); int i; for(i … |
|
I have a generic text file, which can be composed of text data and numerical values, like an article. It can have multiple paragraphs/lines and have various types of delimiters. My general purpose is to tokenize this text file into a string array. I am quite confusing on how to … |
|
I am working on may code and I received a null pointer error , how do I fix this? all I wanted to do was remove the selected array here's my code [CODE] import java.util.Scanner; public class Game { public static void main(String args[]){ Scanner input = new Scanner( System.in … |
|
Isn't it better to use the BufferedReader function readLine() instead of read() or read(byte[])? The reason I ask is because of potential memory wastage by the read() function. If I specify a byte array of size 10, then it will become capable of accepting ten bytes from the transmitter. However, … |