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.
Related
If i want to make a web application in java i mean JSP should I create an Applet and put it into a browser or create "Java web project"?
In other words the big companies system like Oracal and others have there own system by creating java web application or using applet and putting it into browsers.
Thanks
I would create a "Java web project".
Using an applet is considered a bad practice due to all of the security issues, the need for the user to install the correct version of java, and enable it in the browser.
Go with a solid java web framework like spring / spring-mvc. See this guide on how to start: https://spring.io/guides/gs/serving-web-content/
Java Applet runs on client side (in the brouser, like javascript), but JSP is part of Java Servlet API and runs on server side (you need to install servlet container like Tomcat to run them). It's not equivalent technologies with different abilities and application area.
Applets are old fashioned now, Applets were used to create interactive web applications in the early days of http development when developing a interactive website was not possible using any browser based technologies like html, css and java script.
But now the things have changed with the evolution of web-2.0. Now you can develop the interactive web application by using only browser based technologies and you don't have to install any third party tools or plugins like in the case of applet, JRE should be installed on client machine.
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.
For my Java project I need to embed a web server to provide various web pages to the user. Until now we used the "official" com.sun.net.httpserver.HttpServer class, which basically works fine.
However, now we want to extend our application in order to not only serve static HTML pages via the embeded HTTP server, but also dynamic content (PHP if possible).
Any recommendations?
EDIT: Nevermind, I found it quite easy to integrate Jython within my Java application :)
Do JAVA apps have to run on JSP? Are there other ways the app can be interpreted on the client side?
Clients (assuming you mean browsers like Firefox, IE etc.,) can understand HTML and Javascript only. Your JSP code will be executed on server and respective HTML code will be sent to browsers.
There are lot of alternatives like JSF, HTML etc., are available. I would suggest reading this tutorial.
JSP is a technology that runs on the server side and produces a response that will typically be viewed in a web browser. There are many other ways to do the same, including Java servlets, JSF, etc.
Java can run on the client side either as an application (i.e. the user downloads a file and runs it locally), or as an applet (which runs in the web browser).
How do I connect my Java Desktop application with a PHP Web Application. Any example codes and technologies I should know of? I just want a simple implementation (its a school project and I don't have much time to perfect it)
On the web side, perhaps I can have a REST-ful API. But what about the Java Desktop side (I'm more of a web developer). How can I pull & pull data from my Java app?
You can create an http-endpoint in the desktop app as well. For instance you can embed a simple servlet container like jetty.
Once you have a servlet container, you can use something like Jersey to write a REST API (or you can just use the Servlet API).
Another option is to create a ServerSocket in the java app, and connect to it from the php app.
There is also a php-java bridge, if you want to get really fancy ;)