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).
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.
This question already has an answer here:
Using .html files as JSPs
(1 answer)
Closed 8 years ago.
OS: Windows Server 2008 R2 SP1
Web Server Front-End: IIS 7.5
Web Server Back-End: Tomcat 5.5
AJP Connector is used to pass JSP content from IIS to Tomcat.
I have a number of project folders that get delivered for web consumption every so often. The web pages themselves end with the HTML extension. They need to be hosted on a Tomcat web server and I need session management control via a JSP application. That is, it's not enough for me to check if the session is active for Tomcat. I have some session control specific to the JSP application itself.
I suppose I could run a script which takes the multitude of HTML pages and converts them into JSP, but I'd like to keep things as "drag-and-drop" friendly as I can. I'd rather not make any changes directly to these project folders.
Is there a way I can enforce Tomcat to treat HTML pages as JSP pages? I.e., If, for example, I wanted to include JSP expressions inside the HTML pages, I could do that.
Thank you very much for any help.
Jsp pages are similar to html pages they are actually scripts included inside html pages, they are written in between <html></html> tag
so you can access jsp pages as html
Just save those pages with.html extension
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 :)
I would know if there is a way to make a Java desktop application to communicate with an applet, in order to call Javascript functions from the desktop app (through applet).
The context :
In one hand, I'm having an ExtJS application (full-AJAX), which is located on a remote server.
In the other hand, a desktop Java application (netbeans application), which is resident (indeed).
What I would do :
Each time one of the apps is used, it sends events & data to the other app.
After a few research, I saw interesting posts here and here, and also an answer on how to communicate between applets (see also here).
The question is not about how to do cross-domain from the applet to the destktop app (see over there and here), but as said in the beginning how to communicate from a desktop java app to the javascript.
Notes
The webapp (ExtJS) is based on a remote server, the applet too. I can locate the applet locally, but it implies to deploy a local webserver.
The desktop app is very heavy, so I cannot convert it in an applet format.
I put the "reverse-AJAX" tag because it is the global concept of what I would do.
If all this is possible without an applet (no Flash please), it's okay too.
In order to call javascript methods from a Java applet in a browser you need to use the Netscape LiveConnect API, there are some examples here.
Basically this is an API that is implemented natively by the browser and allowed a java applet to access the javascript engine of the browser.
Once you have that sorted then you need to call methods in applet from the desktop application, this is a little more tricky. The most easy way would probably be to have an Enum that you exchange serialised instances of to describe the type of event.
There is an example of using sockets for communication here.
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.