• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Java For Web Development: What should I focus on?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Bear Bibeault
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Jim Rosenberg
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Author
Posts: 3473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Fabio Falci Rodrigues
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
Bear Bibeault
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Fabio Falci Rodrigues
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to get Java Web Component Developer Certification, or a book that prepares you for it. Basics are in there.
 
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Jim Rosenberg
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Bear Bibeault
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
arulk pillai
Author
Posts: 3473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Start with Servlets and then move to JSPs.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Right! We're on it! Let's get to work tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic