I've been trying to find a proper way to pass some information, such as password, to my applet. Since the code is executed on the client, I don't want to put that information in clear text in the "param".
I'm using php as script to generate the web page. So, I was wondering if there was already some kind of solution/mechanism? If not, I suppose the only way would be to encrypt the password in php, pass it as a param and decrypt in the applet? My only problem would be that the way to decrypt it would be in the client applet as well. For that I suppose that someone could decompile the applet and look for it? Or is it safe enouph?
Anyway, I'm looking for a good solutions, hope there is one?
Thanks in advance.
There is no secure way to do this. Any data the applet has access to the user has access to. It is quite trivial to decompile Java applets, and even obfuscators only add a little delay.
An idea:
The applet can contact the server for the password (let's say using https).
Then connect to the (s)ftp server.
Note that if you're using ftp and not sftp, maybe the password is passed in clear on the network.
Related
First I would like to thank this excellent site for all the help for the developers.
I am facing a problem that I need the user to browse to a specific folder on his/her machine then click the submit button.
I like to get all the filenames and types from this folder and read it in a servlet.
Idon't need upload functionality, I need to read the filenames and types in the selected folder.
Is this possible?
Thanks in advance.
The problem with reading the local file system from a web-page within the browser is the sandbox the browser runs in. Normally, you are not able to get out of that sandbox to read the local file system in such a way.
There are a few way around that, for Java you could use a signed applet, or you could use an signed ActiveX control.
Both shouldn't be that difficult, but the Java applet will have a better support all round, since the ActiveX only works on windows.
It's the signing that will become the real problem though. Is this something in a contained environment, or for the actual internet for everyone there to be able to use?
If it's a contained environment, you might be able to pull it off using a self signed certificate. Else you will need a certificate from an actual certificate authority. These can get pretty expensive.
I have a java application that has information that I need to display on a webpage, sorta like a chat room, The way I'm currently doing it is by having the java application listen for connections on a specific port and then I have a PHP script that connects every second to update the information listed on the page, What I'm trying to find out is there a better way of doing this? I haven't done anything like this before so sorry If this method is really stupid, I'm just looking for the best way to accomplish this. All constructive comments are welcome.
EDIT:
I forgot to mention that I'm doing this over TCP and I do not have access to MySQL so I can't store anything In a database then have the PHP script go and retrieve it..
Well it depends strongly on the flow, when should the communicate? If PHP needs data from Java then just do a call and parse the data back in xml's. Else if it is a lot like a chat, there should be a way to socket it, although I have never tried it.
I was wondering if it was possible to send information from a java applet to a PHP page (and in the long run, a mysql database) on the click of a button (within the java applet).
Of course, if it's easier to just incorporate the jar file instead of an applet, that's also a possibility, but I just don't know how to do that...
Any ideas?
Yes, you can do that. You'll need to grant the Applet permissions to access the network though. Here's an example.
Using Matlab, I'm trying to download a file from a website that requires you to login first. The file I'm trying to download is here (http://www.standardandpoors.com/prot/spf/docs/indices/SPUSA-500-USDUF--P-US-L--Constituents.xls)
I'm guessing this involves cookies and hacking into the java code in the urlwrite function. Has anybody done this or does anybody have ideas on how I get started? Is there some standard way to login and get a cookie, and then pass the cookie back with future requests?
I would think system, rather than tool. I agree with Alex - Perl to download, maybe Pentaho/Kettle to parse/process. Especially if you're going to do more of this.
i want to get client MAC address (in jsp,java)
it's possible? how to do?
thanks for help
Unfortunately, this is not possible directly in JSP because it will not be passed as part of the HTTP Header. You would need to have some client side script to run, that has access to the network adapter to find this information.
I am not sure if an applet would be able to get this for you, but this would need extended permissions if it were possible, and a user is unlikely to allow it.
Why? Are you aware they can be changed by intermediiate routers? And users? So they are of no practical use except to the network layer?