Problems with web application after moving from Windows to Linux host - java

I have developed an web application using xhtml, jQuery, Ajax, java, Servlets & tomcat on window machine. This application is running quite well on my Windows machine but now I have uploaded it to a Linux machine.
There are some problem I am getting on Linux machine e.g.
Web page resolution & size: I fixed it but want some more suggestion on it. If anybody has faced any similar situation.
jQuery/javascript: Some functionality isn't working on the Linux machine and I am not able to figured it out. I guess javascript/jQuery functions should be defined in a Linux way. Please give me some ideas on it.

Regarding your second issue, Linux is not affecting your javascript, but the browser does. So you don't have to define your javascript "in a linux way" as you say, just be sure your javascript code is as cross-browser as possible OR use the same browser in both operating systems.
For example, your page should behave the same in Firefox for Windows and Firefox for Linux.
Hope this helps. Cheers

Related

Running a Java Applet in Current Browsers?

I have created a Java applet as part of a request from a client for a web-based program, and while I've gotten it embedded, Chrome has disabled support, you need to bypass various security protocols in both Internet Explorer and Firefox, and Edge doesn't have support for java in the first place. My question is, is there some sort of way we can run this program through a wrapper or an alternative way of getting it on the web without re-writing the entire program in a different language? Thanks!
Realistically, as you're seeing, applets are dead. Your best option is to use Java Web Start and convert your applet into an application. That really isn't too bad to do but it will require some work.
Basically the server sends a JNLP file that runs an application. The application (i.e. your Java application) can be downloaded from a remote server so that you don't have to have pre-installed anything except for Java on the client machine.

Why install Java separately in a browser?

I am trying to understand why we need to install Java within a browser despite having a JDK/JRE installed on the desktop.
When a browser prompts us to install Java , are we actually installing a separate (may be a more condensed version of) JRE ? How is this different from JRE that is installed on the desktop ?
Does the java installed in a browser interact with the one installed on the desktop ?
Say for instance , my web page is running applets. I need to run the applets (bytecodes) on a JVM right ? Why can't the browser just run this on the jre installed on the desktop ?
Can some one help me understand this better ?
Browser can't access JVM installed on that machine/host. It's mainly due to security reason. If it's allowed, just think what not we will be able to do through applications running in your browser. It will create plethora of security problems. Designers have intentionally put this restriction.
To execute applets and some other programs you need a separate JRE/Java for your browser.
And similarly, your host can't use Java installed in browser.

Java applets launched using deployJava.js not working for Opera/Chrome on Mac?

I noticed that the launching of Java applets using deployJava.js seems to have stopped working on some Mac browsers. Safari and FF still work, but Opera and Chrome send the user to Java installation page, as if the plugin was not found.
Take for example this. If you click the launch button in Opera, it sends you to a Java installation page. Any ideas on how to fix this?
I ended up checking User-Agent HTTP header for "Opera" and in this case using standard tag. For any other browser I use deploy deployJava.js as currently served by Sun.
I know that there are modified versions of deployJava.js (e.g. this one used by Atlassian JIRA) which correctly start the applet in Opera instead of sending the user to Java installation page. But in my case, this approach caused ClassLoader issues (truncated classes) with Opera as I was using applets packaged into several jar files (main + 3rd party jars). had no such problems, even with Opera (which has buggy Java support as Sun claims).
Strangely, I had no issues with standard deployJava.js with Chrome (checked on Linux and Mac Snow Leopard).
As an alternative, could you offer a plain link to the .jnlp?
From the "Deploying a Java Web Start Application", "If you are not sure whether your end users will have the JavaScript interpreter enabled in their browsers, you can deploy the Java Web Start application directly by creating a link to the JNLP file..."

How to start a local port on user's computer (Edited question)

sorry in the past I have not been able to formulate my question coherently. This will be my last try. =|
Basically, I want to do something like this website is doing: http://www.ninjavideo.net/video/56388. They are rendering an iframe that points to a port on localhost. You will see nothing in the iframe if you dont have their applet running (which can be found here: ninjavideo.net/applet.php ). I want to write a script that does something like what applet.php is doing, but I don't think they are using only php code as it won't run on computers that don't have php installed. Do you suppose they are using Java/C to do this?
Thanks for all your suggestions.
An Applet is basically a piece of Java code which is served by a webpage and is supposed to run at the client machine. You can learn more about Applets at Sun's own Applet tutorial. If you're green to Java as well, then I recommend to go through Trials Covering the Basics first. Opening sockets (ports) using Java code is covered here.
That PHP script is just serving the applet code from the server, so that the client can download it.
You could do this in PHP using a ready-to-run Apache setup (there are some that are ready to run from a USB key, should be possible to make into something that a client can install, but is complicated, see e.g. this tutorial) or a product like NuSphere Dock:
PhpDock is a deployment platform for PHP applications.
PhpDock enables you to deploy any PHP web application as a Stand Alone Windows Desktop application w/o any changes in the code.
PhpDock combines NuSphere's powerful embeded Srv webserver and browser components.
I would usually say that if you are looking to build a Windows application, you should go with a tool that is aimed at just that, i.e. C++, C#, Java, the .NET platform, Delphi, and the likes. But if you need some kind of daemon or local web server, you may actually be well off with a product bringing a web server to the desktop.

Java Applet crashes .NET Webbrowsercontrol

in our application we have a Java applet running inside a .NET browser control. It is a know issue from Sun that running an applet this way may crash the control.
Has anyone come across the same problem and solved it?
Atm we are running the applet in a Webbrowser but we need to run it in a browser control.
Thx for any help.
After some time the problem solved itself.
It was indeed a bug in the java runtime which is now fixed by sun. Just make sure your JRE is > 1.6.10.
If you wrote the applet and have source, then you could try to migrate the Java Applet to a J# Browser control and stuff that in your .net application.
Here is a link - http://msdn.microsoft.com/en-us/library/aa290083(VS.71).aspx

Categories