Java for the web

I posted this question: https://stackoverflow.com/questions/418597/java-and-net-for-php-programmer and the answers I got didn't really work for me.

I have read some lessons in the sun. I understand the basic syntax. What I don't understand and really need (because I think my company is going to tell me to start working with this) is to learn how to work with java for the web. I am a php programmer and I did some asp.net C # some months ago. I really don't understand how to work with java on the internet.

I have installed netbeans. When I start a web project, I also ask what framework I want. I don't know any java frameworks (I know about spring, but never worked with it). Isn't there a simple tutorial on how to make java for the web? I never had such problems when I first got acquainted with php :(

Someone will help me, or at least point me in a good direction.

0


source to share


6 answers


You may find this question helpful.

All you really need to know is HTML, Java and JSP s.



Creating dynamic content is very easy with JSP and Java. You also need a web server like Tomcat or Glass Fish .

As far as the Java code in the back is concerned, there is no difference between this and a desktop application. The only thing you change is the user interface. One of the biggest challenges when switching to the web interface is the fact that it is stateless by design.

+2


source


Frameworks make web programming easier, they are not required. You can write web applications using plain old Servlets and JSPs (with a web application container like Tomcat or JBoss), or even all the HTTP I / O inputs themselves (obviously this is pointless with Tomcat, etc.) ...

A framework like Spring with Hibernate etc. is like PHP frameworks like CakePHP, they simplify development, provide robust templates (MVC) for the programmer, abstract code that will always be executed for this type of use. Yes, they limit your options and abilities and limit the actions you can take to varying degrees. Some are much heavier than others. But there are many choices in the Java world, which is a strong point, but you just need to take the time to evaluate them and choose one based on your capabilities.



Take racks and tiles. You can simply use Struts as your MVC system and avoid all JSP utility tags used. It will take you a short time to rewrite the functionality that you end up using yourself, but at the time you don't have it, and then debug, as well as certain domain knowledge and experience that you cannot account for.

+1


source


Are you familiar with MVC? Several frameworks are implemented in Java. Struts is one of the most popular. This can help you get started using Struts and work through the tutorial.

  • This tutorial is a good one that also introduces you to spring.
  • This tutorial is about struts in netbeans
0


source


On the technical side, you can start downloading Tomcat and code the exercises and documentation.

By "architectural" sie you code the business logic in Java, that is, all the components that take a parameter on the client-server communication (request), manipulate it and use it to create the result.

this result gives the server-client communication (response) and it appears with the presentation layer (JSP, etc.) in the web page.

The explication is very accurate and not very "orthodox", I know. It is important that you understand.

0


source


The programming model that (in most cases) is used when writing a Java web application is actually a subset of J2EE. Not a rocket science, but you need to know at least its pieces. Become familiar with the concept of the J2EE Web Container, the J2EE web application, its descriptor (web.xml), servlets (which are actually the basic building blocks of any J2EE application) and, of course, JSP.

Sun has many good tutorials on their web pages. Including any of the above terms with "site: sun.com" usually produces good results (for example, this is about the concept of servlets: http://java.sun.com/products/servlet/articles/tutorial/ ).

I also forgot about web frameworks and started with J2EE stuff and then MVC as a design pattern. After that go to the web framework. Using a framework tends to help a lot, but even when using one of them, you still need to know the basics.

0


source


Since you are using NetBeans, start with the tutorials they have on their site. http://www.netbeans.org/kb/docs/web/quickstart-webapps.html

Go through the simple tutorials on the site before you start talking about any frameworks.

Java webapps are pretty simple. You have Java classes (.java) that handle your business logic and your .jsp files that handle your presentation. Try to keep them separate. You also want to familiarize yourself with JSTL tags and el syntax (expression language)

0


source







All Articles