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
Related
I'm building an application for a company and I also have to handle the deployment.
The application is a java restful API which I usually deploy on a tomcat. The front end for the application in written in PHP (not by me) and will be installed on the same machine. The back end must be reachable both from the front-end and from the web.
What is the best approach, considering that this is a production environment?
Do I install everything on a tomcat? Both the war and the php application.
Do I install the war on a tomcat and the PHP front end on Apache web server?
Do I connect the tomcat to the Apache web server?
Something else entirely?
Also are there downsides on having both the back-end and front-end on the same machine?
If your back-end uses the Servlet API, you require a servlet server and Tomcat is a common choice. Even if Tomcat provides CGIServlet, I believe nobody uses it on production servers to run PHP scripts. So you need at least two servers.
I would extend it to three servers and run:
the back-end on Tomcat (bound to localhost),
the front-end on a PHP FastCGI server like PHP-FPM (bound to a Unix socket),
a proxy server like NGINX (lighter than Apache2) to connect to PHP-FPM. It does not have to proxy Tomcat, since everything is on the same machine.
i have just created a web project that contains a bunch of jsp and html pages.i need to know how to Deploy them(or provide access) to client computers using a single server(intranet) and where do i need to install JRE because jsp have java code and sql queries in them which interacts with mysql database.
You just have to install a J2EE container into your intranet and deploy your war file on it.
You can easily do this for example using Apache Tomcat, but there is a lot of other products, free or not, on the market.
Quite simple ! Create its war file using any build tools like maven or ant and deploy it on tomcat server and start your server.
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).
I have installed Java and developed on my laptop. Now I want to access those files from my PC using HTTP. Both machines are on the same network. I'd like to access the page as we do in PHP:
http:// and the path
How can I do it? I can see the files using this url: file://machine-name/login.html, but it's not opening in HTTP, replacing file from the url. Please help
Unlike PHP, in Java you can serve only JSP or Servlets. You will need to have an Application Server - like Tomcat, to deploy your web components. There are many different ways how you can package your web components. Typically all files (JSP, Servlets, Classes) etc. are packaged in a 'war' file. Thiw war file can be deployed to any Java compliant application servers.
Try this URL - Simple Tomcat application
Hope this helps.
Regards,
Sreehari.
I Require a clarification on one Technical Implementation to check its feasible or not.
I have one VPS server which has a Java Environment and I have one more dedicated server which doesnot have a Java Environment where i have built my PHP based web application,
In the VPS environment I am planning to implement the XML based application using the Observer pattern with java and DOM Parsers and make that application available at say for example
123.124.125.65/XML_Works/Sample,xml file
Now My doubt is that: 1)is it possbile to access this application in dedicated Server where the java environment is not there.
2)if yes, then is it possible to access that java + XML application in IFrame in PHP based web portal.
1) No JVM = no java running on that machine
2) The most common solution I saw (and am using) is to externalize the java functionality you want as a web service or servlet and package it as a .war
Then use some web container such as tomcat to load that war and use a connector to connect calls to tomcat to your PHP server.
So the configuration I use is, Java as war, Tomcat as web container, Apache as PHP server and mod_jk connector for communication between servers.
Note that the mod_jk connector also supports other web servers.