What if you want to create your first Java application?

So, I want to create my first web application. But there are simply too wise choices to know where to start, I keep jumping from one thing to another.

The first thing I have to use:

  • better for web development than the other, or is it just a personal choice?

I am currently using netbeans and I can see that all the samples are using glassfish.

  • Should I use it first glassfish

    ? or should I look at tomcat

    , jboss

    ...
  • When I use the example glassfish

    and switch to tomcat server some classes are no longer recognized. Does each server have their own classes?
  • When I followed the tutorial spring

    it used tomcat

    , but can it be used with as well glassfish

    ?
  • Is there a big difference in cost between servers?

How about jsp

orservlets

  • In many examples use jsp

    , some others prefer servlets

    , what is still in use nowadays ??
  • I also came across some sites where they prefer / freemarker

    instead of , but wouldn't it be better to learn to work with and ?jsp

    servlets

    jsp

    servlets

What about frameworks

  • is it better to use type frameworks spring

    to start with a beginner or not?

And build tools

  • Should I use the construction of instruments, such as maven

    , ant

    , gradle

    ? or will it be overkill on the learning curve?

And how is java web app stored on servers?

  • Now I am a normal site with html css and js you just need to drag and drop all files to the server and it works. But what about java webapplication works the same?

All I want to do is just start and build from there. But I really need some guidance on what is best to learn first and why.

+3


source to share


4 answers


There is no one size fits all answer, it all depends on your needs.

If you are already familiar with Java IDE you should probably stick with this, NetBeans will most certainly be sufficient for EE development.

For servers, you should look at one issue:
If you need more than Java EE Web Profile (Java EE 6 Web Profile vs Java EE 6 Full Platform ), you need an application server like Glassfish or JBoss (WildFly) as Tomcat does not ship with a full Java EE profile. Otherwise, you should find sufficient documentation for any of them. I personally use JBoss 7.x / WildFly 8 and have never had a nasty problem.

Both Servlet and JSP are a little old fashioned already, I would recommend JSF if you want to create a larger application with clean code separation. But knowing the basics of a servlet or JSP helps with getting started with JSF.



As of Java EE 6/7, I recommend sticking to standards. For example. using CDI or EJB instead of Spring and just use standard JPA this way you can always change your JPA provider or webserver without a lot of code changes if you run into some problems. Hibernate is a good choice for JPA, but EclipseLink can do just fine too. If you do this, most of your code will be independent of your chosen server. This leaves a configuration that differs from server to server, but in most cases is only needed at the beginning.

Development and dependency management tools like Maven help a lot, but are not required to get started. Note. These may require a special directory structure, so it's best to start with a skeleton project.

As far as deploying web applications, you usually package them (for example, as WAR - Web Application Archive) and then delete them in the server spoloment folder.

+1


source


It might be too broad a question, but to keep it simple:

If this is your first application, but this is not just a small test:

Frameworks

Server



Database

Readings and tutorials

+3


source


To make it easy to get started and slow to digest, I would recommend a basic welcome web application using Spring Web MVC, Netbeans as IDE, Tomcat 7 as your server.

then you can go to database integration and then explore hibernation. For the database, you can use MySQL.

Related links:

0


source


Vaadin

An alternative way to create a Java web application developer is to use Vaadin .

Vaadin_Logo.svg

Included in two issues:

  • Java-based web application platform (for Java programmers)
  • Web Components - Compatible Parts (for JavaScript Programmers)

First, for Java developers who want to develop professional looking complex "one-page" web applications without (HTTP, HTML, CSS, DOM, JavaScript, Ajax, Comet, Push, WebSocket, etc.). All of these web standards technologies are used at runtime, but behind the scenes, are transparent to you as a Java programmer.

With Vaadin, a Java developer says, "I want the layout to contain some widgets on the screen, and those widgets should be this button, this button, some text boxes with labels, and a data grid." Vaadin automatically generates the required HTML + CSS + JavaScript + etc. at runtime. to render this UI remotely on the client (any common web browser).

When the user clicks one of these buttons or types in one of these fields, your Java code running on the server side is automatically notified of this event. Your code can react by manipulating business logic, storing data in a database, connecting to a web service or other data source / sink ... all are done on the server side without any client / browser involvement.

Vaadin is implemented inside Java Servlet . It works on any Servlet powered web container like Apache Tomcat and Eclipse Jetty . You can selectively add libraries from Java EE to this container. Or you can use a full featured Java EE server like Glassfish . If you like CDI / Spring , Vaadin can handle this too.

-1


source







All Articles