Alternatives to Jibble Web Server with php support? - java

Well at school we are not allowed to run .exe's (YES WE have windows... omg why, also you can't save DLL files) so when I needed an FTP server I just download a Java FTP Server named FTP-GO. We can run jar files, but only by double clicking on them, so we cannot provide any parameters. What I want now is a web server in a jar file which also supports PHP scripts, the disk limit I have is 100mb, of which I am using 25mb (but I can run jars from an USB stick). so if there is any equivalent to http://www.jibble.org/jibblewebserver.php which also supports PHP, which one would you recommend?

Maybe Quercus or Der Herberlin Bremsserver.

Related

How to rewrite csv file on client with java web application

I am new in java web application, (Java EE, JSF).
I tried to change the contents of a csv file on the client computer with a java web application, so that the client does not have to download a new file, because the file is already in the set to be used for applications in the client. so I just wanted to rewrite the csv file.
Could it be done in java web application? If yes, please give me an example. I am very grateful if there is a better solution.
No, absolutely not. You can't change the contents of a file on a client computer from a web browser. The best you could do is have them upload a version of a file and then send them another version to download. Giving write access to the filesystem would be a massive security hole.
Place the CSV on a network share somewhere. The client can edit it, the back-end server can edit it. Requires more infrastructure, of course, but may work depending on the type of application.
Not that I think this is what you want, but if the 'client computer' was also acting as the server (i.e. was the host running Jetty/Tomcat/whatever), then you could modify files on it using the java IO api.
Again, very likely not what you want, just saying it would work.

How to make a runnable JAR file that can read/write files?

I have created a Java software with a graphical interface using SWING. I have packaged it in a runneable JAR file by using he "export" function of ECLIPSE and it runs fine on my computer.
However, the function of reading files of my software does not work on some other computers.
I guess that it must be a security permission problem.
So my question is: how to give the permissions to my Jar file or how the user can give the permissions so that my software is allowed to read file?
I'm looking for something as simple as possible as i'm not going to sell my software.
EDIT: My application is a desktop application (not an applet).
Thanks,
Digitally sign the Jar.
Create an XML based (JNLP) launch file for it.
Launch it from a link using Java Web Start. JWS can install desktop shortcuts & menu items for it, if requested in the launch file and supported on the target OS.
I'm looking for something as simple as possible..
Installing applications in a way that is reliable & simple for the end user, is not easy for the developer.

Moving a file from a windows Java application to a linux box

I'm currently doing a project that has to be run on a windows machine. The application creates a CSV file and saves it to the windows filesystem. I would like a way to transfer this file to a machine running linux into a directory selected by the user.
I am not asking for code (although if it helps then feel free :P ) but asking more for what protocols to use (ftp etc) and wether I need to take anything into account such as permissions in Linux as I am fairly in experienced with programming for linux file systems.
Thanks in advance :)
Can the windows machine see the linux filesystem? Is there a samba server running on the linux machine? If so, you can simply copy it from one filesystem to the other.
If not, you can try SCP or SFTP but you need to have the keys setup. Another way is to use Runtime.exec to copy the file using a windows specific command utility.
If all else fails, run a java process on the linux server and connect to it using sockets. Your windows client can write the file to the socket and it can be written out by the linux server.
I would try using SSH as SCP is a fairly standard and convenient way to transfer files securely. In Java you can use jssh amoungst other libraries.
If you don't want to do it programatically, I'd suggest using Rsync. It should be available for most *nix distros and you've got a Windows version called DeltaCopy that implements the same protocol.

News Articles: Write to server disk without PHP?

I'm looking into a small project just now where we have a need for a very very basic news article system. Ideally, this is a simple XML file that will be written to with some news, and then parsed to display on the homepage. This file is on the server, of course.
My question is how to allow a client browser to write to this XML file, given that the server will not have PHP enabled?
I know of TiddlyWiki which uses a .JAR file to allow the writes, but are there any other methods I should try?
Since FTP seems to be enabled/supported, your best bet is to create an applet which does the job. FTP connectivity can fairly simple be done by Apache Commons Net FTPClient. Your only problem is that the FTP connection details needs to be embedded in the applet somehow and that anyone with bad intent can extract it from the applet's source code since applets are downloaded into the client machine.
Without some serverside code, you will not be able to write files to the server.
You need a "PHP/Java/FTP-Server/something else"-backend serverprocess to take the content and write it to a file.
Apache supports HTTP PUT, and some browsers support it in XMLHttpRequest. So long as you are willing to limit editors to browsers that support it, you could use that without installing additional software on the server or using a plugin on the client.
FTP would definitely work, depending on how well the user doing the updates is familiar with it.
If the upload solution needs to be browser-based, you could perhaps run an FTP applet and have the user remember the connection details/password.

Data download from server

I want to download multiple files (file is in zip format) from server to client machine specific path within unzip format. How can I achieve this?
If the server exposes these files as an HTTP resource, any HTTP client program (such as wget, cURL, browsers and others) would be able to retrieve them. If the resources are exposed in another fashion, you'll need to use an appropriate client for that (e.g. SMB shares you can mount the resource using Explorer or SAMBA; FTP you can use an FTP client; etc.).
To download multiple files, unless you're talking about thousands, you can simply invoke the client once for each file. If you want this to be done programatically (e.g. as part of a build), this can be done with a shell script (batch script in windows) or as part of some higher-level construct, e.g. an Ant script if it's part of a Java-based project's build.
If your problem is that the server isn't currently making the files available, you'll need to make your question more specific to clarify this.

Categories

Resources