link between java and javascript - java

I want to send raw data from server which is written in simple java program to javascript. The server is not the java applet ( i don't want to involve java applet). I want to have access to those data from javascript or HTML5 to display in web browser.
LiveConnect, JavaFX,etc deal with java applet. I also don't prefer servlet. This is because i have simple java server program ( not applet or servlets)
Could anyone please how can i play with those raw data in java server from client side ( javascript) to display in web browser( web application).

You need a web container (tomcat, glassfish, jboss, etc) as the bridge of client browser and java application in your server to access your java application and its classes. Then, the client browser send request to the web container. Web container send request to your java application and send respond from the java application to client browser.

Related

Deploying JSP to users like a setup.exe or .dmg file

I'm researching using JSP for a project that could be accessed locally and over the web. That is, I would be creating the project in JSP and would like to generate a kind of setup.exe that the client would run to set up the environment to run the JSP in their browser. For example, if I were to choose Tomcat, do I create a setup program that also installs Tomcat and then stores the JSP application in the proper directory? More specially, for those in the industry that program JSP professionally, how does your company deploy a JSP application to the client? If you host the JSP application on your server what about a solution where the client hosts a local server so they can run the application locally on their machine? Is that possible?
I think you have some confusion. In a JSP-based application (note that that technology is very old and you should use JSF instead) there are two sides: the server side and the client side.
The server side has Tomcat or any other Web Application Server that
deploys the JSPs as you said.
The client side just needs a browser (e.g. Mozilla, Chrome, Lynx,
etc) to access the JSP-based application via Web.
In other words, you don't deploy in client machines. You just deploy in the server and your clients access your application with, normally, a Web browser.
Further reading:
Java JSP, JSF and JS.
Difference between JSF sevlet and JSP

Can java access ASP.Net Session Data in Memory if both apps are on the same server and Java has the Session ID?

I am building a java Rest Service that is located on the same server as a .Net application. The client is hosted within the .Net Application but it communicates with a Java Rest Service. We need some way of accessing the Users Session data in .Net without altering the .Net code. So my question is...
If the java Rest Service app is located on the same server as the ASP.NET app. This means ASP.NET is saving the users information on the servers memory. If we have the Session ID. And its past to java, is it possible for Java to retrieve that information in memory by using the Session ID ?
In general what are my possibilities.
The java application and the ASP.NET application are both on the same server and on a windows server.
Thanks

Apache Tomcat - language and tools for deployment

For context, I developed a web application using JS & HTML that allows a user to manually upload a log file (from a shared folder on a Tomcat server) and display errors, info, etc based on the format of the log file.
However, say I want to cut the user upload, and automatically retrieve files from the Tomcat server (running on an Apache instance - so web app would be deployed on the Apache box) and then display the information on a web page - would I need to use a java servlet, or could I use php with js? I doubt that I could do it server-side with JS? Any advice?
Yes, you'd need something on the server side (e.g a java servlet, a php page) to grab the content from the server and make it available to client side (e.g html+js).

Client Side Java Web technologies

I have a bunch of shell scripts on every client machine. I need a web interface to provide settings for these scripts and it should invoke these scripts.
If i run a web application from a server to run scripts, it will overload the server due to multiple client requests, so client side web app is preferred.
Applets can solve this. But, it is outdated and I dont like it.
Is there any other new/good technologies to do such client side computing ?
Are you talking about web application or desktop application?
If this is a web application, so as far as I know - no. You must use applet embedded at your web page to run the script.
If desktop application - it can use the API for execution processes at Java.
Another option is maybe to download some small server code that will be used to invoke scripts, and have you web application communicate with it, in order to invoke a process.
The downside of this is that this is not a "straightforward" usage of your web application.

HTML Interface for a java chatclient

I have this project thats about to start. We're making a Chatclient that we want to integrate to a webapp.
We have the following requirments:
- Java server
- Java client
We've practically compleated the coding of both the client and server, but the thing is that we want to integrate the client applet into a webapp with all the layouting done in HTML. Basically, we need a interface in HTML but the backend in java on the browser. How do we do that?
you should consider rendering your HTML client code with Java Servlets os JSP.

Categories