Forums Register Login

Java For Web Development: What should I focus on?

+Pie Number of slices to send: Send
I have been employed mainly as a Perl developer, but I am looking to make the switch to Java. I would like to stay in web development, but am wondering what I should be focusing on? Is JSP more popular than Servlets? If I go with JSP, should I get familiar with one framework, or should I try to avoid them so I don't get too comfortable using it and cannot program without it? What about another add-ons, like Hibernate?

There are a few sites I would like to make and I figured I should just do them in JSP/Servlets to get ready for the switch over from Perl, but I would like to create the sites using a typical job environment so I can at least have something to show off.
+Pie Number of slices to send: Send
 

Jim Rosenberg wrote: Is JSP more popular than Servlets?


That's like asking if bread is more popular than butter. They go hand in hand.

should I get familiar with one framework, or should I try to avoid them so I don't get too comfortable using it and cannot program without it?


Exactly. Avoid frameworks until you are comfortable with the Servlet and JSP technologies and web application structure. Then decide if you need a framework or not, and which one.

What about another add-ons, like Hibernate?


Hibernate should never even get near the presentation layer. It should be buried in the persistence layer a good distance from the web technologies.

A few article from the JavaRanch Journal you should read:

The Secret life of JSPs

The Front Man
+Pie Number of slices to send: Send
Also be sure whatever JSP reference you use is up-to-date and focuses on modern techniques. If you see that the reference is focused on scriptlets, rather than the JSTL and EL (Expression Language), toss it in the hopper and get a better reference.
+Pie Number of slices to send: Send
 

Bear Bibeault wrote:Also be sure whatever JSP reference you use is up-to-date and focuses on modern techniques. If you see that the reference is focused on scriptlets, rather than the JSTL and EL (Expression Language), toss it in the hopper and get a better reference.


That's good to know...my reference is in fact focused on scriptlets.

How are Servlets and JSP hand in hand? I though Servlets was old and a little outdated and JSP was modern and the wave of the future being more like your typical web scripting language in the sense that it has code in <> tags and HTML outside the tags. Servlets being compiled class files where all the code is in the class files.
+Pie Number of slices to send: Send
The JSPs are eventually converted Servlets. Have a look at the MVC (Model-View-Controller) patterns. It is basically how they divide responsibilities between the two. Also look at the difference between MVC 1 & MVC 2.
+Pie Number of slices to send: Send
The Java Server Pages paradigm is just another way to create one or more Java Servlets. Learn about the "JSP Engine" component of a Java-based web server.
+Pie Number of slices to send: Send
 

Jim Rosenberg wrote:That's good to know...my reference is in fact focused on scriptlets.


In modern JSPs, scriptlets should be considered deprecated.

How are Servlets and JSP hand in hand? I though Servlets was old and a little outdated and JSP was modern and the wave of the future


Far from it.

Did you read the second of those articles I linked to yet? It discusses modern web application structure and details how servlets serve as the controllers for the JSPs.

Again, they are complimentary -- not competing.
+Pie Number of slices to send: Send
HTML + Css + JavaScript! That's the base.

After that you can focus on JSP and web frameworks, like Struts2, SpringMVC, JSF, etc.
And if in this point you still planning to continue with Java, then you can think about in some
libraries, like Hibernate and Spring.
+Pie Number of slices to send: Send
 

Fabio Falci Rodrigues wrote:HTML + Css + JavaScript! That's the base.


That's true, but as a PHP developer, I think he's already got that and is asking about the server-side Java stack.

After that you can focus on JSP and web frameworks, like Struts2, SpringMVC, JSF, etc.


As above, I disagree. frameworks should be avoided until the basics are well understood. Only then can it be determines which, if any, is suitable for use.
+Pie Number of slices to send: Send
 

Bear Bibeault wrote:As above, I disagree. frameworks should be avoided until the basics are well understood. Only then can it be determines which, if any, is suitable for use.



Yes, for sure. He must understand the base and avoid some frameworks, as least for 1 or 2 weeks.
But don't fall in the trap and create a home made web framework. Every java developer do that.

Pick up one and start to produce!
+Pie Number of slices to send: Send
 

Fabio Falci Rodrigues wrote:Yes, for sure. He must understand the base and avoid some frameworks, as least for 1 or 2 weeks.

I hardly think 2 weeks is sufficient to thouroughly understand the basics.

But don't fall in the trap and create a home made web framework. Every java developer do that.


For novices, yeah, don't do that.

More advanced developers who thoroughly understand the concepts often eschew the cantankerous and overly-bloated popular frameworks (and the abomination that is JSF), in favor of something more light-weight, and better suited to a particular task.
+Pie Number of slices to send: Send
Do you think?
I don't no, but I think that just a light understanding is enough.
The web frameworks abstract a lot of concepts.
+Pie Number of slices to send: Send
Try to get Java Web Component Developer Certification, or a book that prepares you for it. Basics are in there.
+Pie Number of slices to send: Send
 

Jim Rosemberg wrote:How are Servlets and JSP hand in hand? I though Servlets was old and a little outdated and JSP was modern and the wave of the future being more like your typical web scripting language in the sense that it has code in <> tags and HTML outside the tags.


You can code only with JSP, and your code will look like a PHP code, but I don't recommend it.

Bear Bibeault wrote:More advanced developers who thoroughly understand the concepts often eschew the cantankerous and overly-bloated popular frameworks (and the abomination that is JSF),...

Why do you think JSF is an abomination?

Vladas Razas wrote:Try to get Java Web Component Developer Certification, or a book that prepares you for it. Basics are in there.

Agree. You learn a lot when you are studying for certifications.

Bear Bibeault wrote:That's like asking if bread is more popular than butter. They go hand in hand.

lol
+Pie Number of slices to send: Send
 

Leandro Coutinho wrote:
You can code only with JSP, and your code will look like a PHP code, but I don't recommend it.



This is exactly the reason why I posted this. JSP looks like PHP. Servlets look like Java. Should I look at straight JSP until I get familiar enough, and then start working with Struts (or some other framework) to make it look more like actual Java? The JSP looking like PHP doesn't seem to fit with the whole Java idea.

I know with ASP.Net, you have some C# classes with the whole code behind method. Is there a way to do something similar with JSP where I would have classes and JAR files?
+Pie Number of slices to send: Send
 

Jim Rosenberg wrote:This is exactly the reason why I posted this. JSP looks like PHP. Servlets look like Java.


Did you read the articles I linked to. The latter one explains the role that JSP and Servlets each play in a web application.

Should I look at straight JSP until I get familiar enough


Absolutely not. All you will do is to develop bad habits that will be hard to break later. Start off on the right foot with accepted practices and patterns.

I know with ASP.Net, you have some C# classes with the whole code behind method. Is there a way to do something similar with JSP where I would have classes and JAR files?


Read the articles.
+Pie Number of slices to send: Send
Start with Servlets and then move to JSPs.
+Pie Number of slices to send: Send
Java Server Pages are servlets, in my opinion. And, if you start off thinking that they are different, then you are already on the wrong track, in my opinion. They have different roles in a web application, as mentioned repeatedly. And they are structured differently.
+Pie Number of slices to send: Send
 

Fabio Falci Rodrigues wrote:HTML + Css + JavaScript! That's the base.

After that you can focus on JSP and web frameworks, like Struts2, SpringMVC, JSF, etc.
And if in this point you still planning to continue with Java, then you can think about in some
libraries, like Hibernate and Spring.



Agree.

AJAX should also be included.
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2408 times.
Similar Threads
JSP/Servlet VS PHP
career advice
Senior Manager, Web Publishing Technology, New York
Offsite or Offshore Java projects or Computer work
JAVA OR COBOL OR RPG OR JSP OR ASP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:13:30.