Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What was SUN THINKING?!?!?!

Status
Not open for further replies.

Goku81

Programmer
Mar 27, 2001
34
US
This is not a question or anything. This is just to vent frustration. Whose bright idea was it for the sandbox design of java???? What a horrible idea. It's a real pain to develop anything useful which involves file handling. You have to go through all this song and dance about certification and all this other stuff. What a hassle. This is yet another pain in my side when I program in java. If java had kept freedom of C++ and the flexibility and range of java (which is the one reason I program in this %$%^ language ^_^ ) They would have a truly divine work of art. You have to take 40 wierd steps in java to do what you could in C++ for the truly useful stuff. The novelty of java has worn off and I think it's time sun gives the developer a better range of movement in java, like having different version for specific OS's and a uniform version of java. That is what I want to see from them. I am through venting. I had to get this off my chest. I've just spent an hour lookin around how to access files on comp and have found it but now I'm gettin somethin about my vsjkey has been tampered with right after I made it......
Ugghh what a pain!!!!!!
 
Code:
public FileReader getFileReader(String fileName) throws FileNotFoundException
{
  try {
    URL url = this.getClass().getResource("/" + fileName);
    FileReader reader = new FileReader(url.toString().substring(6));
    // (cut the "file:/" part)
    return reader;
  } catch(NullPointerException e) {
    throw new FileNotFoundException(e.toString());
  }
}
allow thyself to be the spark that lights the fire
 
forgot to add I'm not just reading from file or accessing, I want to read and write from server the applet is sittin on.
 
Oups - sorry, I don't have no experience with that... allow thyself to be the spark that lights the fire
 

hello, to answer that :

>> I want to read and write from server the applet is sittin on.

you can do it easily :

1) the applet sends an http request to a servlet (or a jsp)

2) the servlet read the file that you want to be read

3) the servlet sends the content of the file to the applet

anything hard with that ? :)

manu0
 
Hi,

manu0 is right, all you need is a servlet or jsp sitting on the server-side and file reading/writing would be simple.

However, if you don't have Java support on your server, perhaps you can use CGI instead?

Regarding the sandbox, well it is good that the person invented it or else applets would be disastrous considering the damage it can do to the client or the server without the sandbox :)

Regards,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
If it weren't for the sandbox then we wouldn't be able to do industrial-strength internet enabled applications.

Goku is right that it can make life awkward sometimes, but those little shortcuts that other languages have can just as easily be used by hackers. My home ----> visit me for Java and Data Warehousing resources
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top