Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am totally new to Java EE. So pardon me if this is too naive a question.
There're so many concepts/jargon/specifictaion in the world of Java Web development. So I am bit lost. Below are my questions:
Do I must use Java EE SDK to develop web applications? Can Java SE SDK do that?
I just downloaded and extracted the Java EE SDK 7u1. There's only a single folder named glassfish4 after extraction. I heard that Java EE SDK is a superset of Java SE. So I am expecting some extra *.jar files containing some new APIs. But where are they?
What's the logical hierarchy Java web technology? It seems everything is based on Servlet.
Java EE is a set of specifications and APIs that define the standards which form Java EE. As such Java EE is not a superset of Java SE which defines the language and standard libraries, but just is built on top of it. Additionally, besides the APIs there is no SDK as such. Just choose an implementation (most people use an application server like Glassfish, JBoss/Wildfly, Websphere etc.) and use that.
If you just want to download the API jars, check the various respositories on the net, e.g. Maven Central etc. The most basic API jar would be javaee-api-7.0.jar. There are a couple of other jars but which you need to reference in your application depends on what you need and which Java EE implementation/provider you use.
You do not need the EE SDK for JavaEE development. It's just a glashfish server and some other tools provided by oracle to enable you to run EE applications.
Any other application server would work just as well.
Depending on your application server, you just package your class files into archives with a deployment descriptor and deploy them to your server, where the EE components are executed.
Since you seem to target web development: Take a look at Apache Tomcat!
It's a EE Web-Container implementation, which allows you to run Servlets and components built on top (JSF, JSPs).
You do not need a fully blown application server for web development. Glasfish seems to be a bit of an overkill for your use case, as you are not looking to run Enterprise Java Beans.
Refer to http://tomcat.apache.org/
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
While Apache http web server is also used for web hosting, why do many Java applications require a Tomcat or JBoss or Glassfish sort of environment for getting hosted?
Please provide the information, applications developed on what Java technologies can be hosted in Apache http web server. And when should we opt for an application server for hosting Java applications?
If you are talking about Java web applications, then they need to run Java code on the web server. A static web server alone won't do that.
That is the same situation with all other server-side programming environments as well (although some of them work via a plugin that is directly embedded into the Apache web server, you still need that plugin).
applications developed on what java technologies can be hosted in Apache http web server
There is client-side Java (applets, Java web start). Probably not what you are talking about, but those run off a static web server.
For server-side Java, always use an application server or a standalone JVM (with an embedded server). Don't try to shove it into Apache (if that is even possible anymore these days). You may still want Apache (or nginx or something else) in addition as a front-end/load-balancer.
Apache Tomcat, otherwise known as “Tomcat” is a servlet container, developed and maintained by the Apache Software Foundation. It is a Java implementation that runs Java Servlets and JavaServer Pages, known as JSPs.
Apache as a web server can be configured in many different ways and with many extensions, but it does lack the ability to serve Java Servelets or JavaServer Pages (hereafter referred to as JSP). Tomcat can and does serve those, and often people who use or need JSP will believe that Tomcat needs to be used to serve these .
The big downside for Apache is the lack of functionality for Java Servlets or JavaServer Pages, which cannot be run with Apache’s web server. Tomcat was created to address this problem.
Have a look here Apache vs Tomcat also here
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Is it possible to use Java instead of PHP with Linux, Apache and MySQL?
the 'LAMP' stack is not some special thing, only that there is a lot of support in the form or frameworks etc based on it. There is no problem to create an application based on Linux, Apache, MySQL and Java (LAMJ) but it will have totally different benefits and drawbacks than LAMP because Java is so totally different from PHP.
Where MySQL used to be the database of choice for Java developers I believe that has now shifted towards PostgreSQL. Some folk like NoSQL databases like MongoDB but that really ties into the Java frameworks you want to use. Also you need some sort of web container to run your Java web application in. The most popular is still a web server like Tomcat I think, you could also use Jetty. For larger projects requiring more extensive application management support and clustering you could consider Glassfish or JBoss.
Maybe you should consider an LTPJ stack (Linux Tomcat PostgreSQL Java). I think that will give you more joy in the way of community support.
EDIT: 2019 update. In my perception the 'standard' has shifted to Spring Boot, with which you can run a web application as a standalone jar using an embedded Tomcat instance. Spring Boot offers a lot of out of the box support like Spring Actuator for management endpoints (e.g. application health).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I loved the diversity of java ever since my first time using it. With that said I have tried to use it to its fullest. I am in the development of a computer game, android game, and website. Yay me. My problem is that I've been learning html, css, and a little bit of javascript for use in an eclipse dynamic web project. I don't see where or how java plays into the equation. To summarize I am asking for an explanation of where java would be used inside of a dynamic web project and maybe an example.
What I have now: http://192.168.43.194:8080/Pointlight_Productions/homepage.html
Dynamic web project is an Eclipse term, as far I know. When you create a Dynamic Web Project, you're typically telling Eclipse to manage your project as if it were intended as a web application to be deployed on a Servlet container. Eclipse will compile your source and resources and produce a .war file that you deploy in a Servlet container (Tomcat, Glassfish, etc.)
A Servlet container is written in Java. But this is provided. You write Java server code. In other words, you implement a number of Servlet classes that handle requests and generate responses.
For example, you might want to show a customized page for a user in an HTTP web application. Your Servlet would receive an HTTP request containing the name of the user. Your Servlet (or the services it depends on) would look up the name in some database, retrieve all the information for the corresponding user, and generate an HTTP response, possibly HTML, that would display that information.
Reading:
Our Servlet wiki page
How do servlets work? Instantiation, sessions, shared variables and multithreading
Java EE 7 Tutorials
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
what is the Advantage/disadvantage of use java ee 6 vs spring framework in enterprise application?
Which one is better for large scale projects(why)?
comparing to java ee 6, what is spring disadvantages ?
i dont have any experience in spring but i want to know difference between them.
Java EE s main advantage is that it is an official framework. It has all the same features as Spring except for the fact, that it always goes in one box - container (even if you do not need some components, they will be present). Of course, it is possible to hook some components of Java EE (like Weld) separately into your java SE app, but it is not common.
Spring on the other hand is more configurable in terms of the components you want. You can decide yourself what you need in your application (usually DI). Spring can also use Java EE features (such as JSP).
If you need only some small subset of Java EE (like Dependency Injection), it is better to use Spring for it. If you need multiple features of Java EE (ie. JTA + JMS + DI + etc), I would go for Glassfish.
The main difference is that with spring framework you do not need a full JavaEE container. Otherwise, they are more or less two different solutions for the same problem. I will not comment on the advantage/disadvantage part of the question since this is opinion based.
JavaEE 6 is much more similar to Spring 2/3 than before. The main Spring features / projects has its JavaEE equivalents and you don't need a full JavaEE server to run. You just need the areas you use.
One advantage of Java EE is to code just having the small JavaEE API as a dependency and leave the implementation as responsibility of the server. You don't need a certified server. You can run it in a Tomcat with just the implementations you need. They already did it for you with the TomEE project.
So that's it. If you want to use just java and javax packages instead of org.springframework in your classes you choose JavaEE.
If you don't mind to use non java or javax packages (why would you?), so you can use Spring and any other non Java library.
Both offers solutions for many problems and all the answers in Stackoverflow will be biased. It's not useful to ask that generic question. It depends. What are you goals. Your syntax and usage preferences. Performance requirements. Security requirements… each component can be better, depending on the usage, and you have the option to use both and choose from each one, what helps you best.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am currently trying to incorporate an open-source business-process-engine (Activiti) into another application from my company but I am uncertain how to do this in a distributed manner. The application shall use certain function of Activiti that can not be provided by itself.
In a previous step I got this running locally by just importing the required jars of Activiti into the application project in Eclipse and making my function calls in the project after importing the right packages.
The next level now aims at running the application independently in its own Tomcat server and own database and to call certain functions from Activiti which is startet in its own JVM as well via network. Up to now I found RMI to be (probably) the right tool for this kind of distributed computing but I am uncertain on where to run Activiti. Another Tomcat server? Even though Activiti is not intended to have any frontend but merely to provide the necessary classes and methods to perform some actions that are by intention not provided by our application? How is the setup practically?
Honestly, I have not fully dug through the documentation of Tomcat yet, but I would appreciate even a short answer whether or not I am on the right track.
EDIT: To put it into a single question: On which platform can I run Activiti in my case?
Best,
Steffen
Yes, you can definitely run Activiti engine on independent Tomcat Server. You can than communicate with this standalone Activiti Engine using Activiti REST API.
But bevare all processes runing on this standalone Activiti Engine need to have all utilized java delegates or spring beans etc. deployed together with Activiti Engine WAR package. They have to be in the same class loader as Activiti Engine itself.