This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Jobs Discussion and the fly likes Java For Web Development: What should I focus on? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Careers » Jobs Discussion
Bookmark "Java For Web Development: What should I focus on?" Watch "Java For Web Development: What should I focus on?" New topic
Author

Java For Web Development: What should I focus on?

Jim Rosenberg
Greenhorn

Joined: Oct 14, 2009
Posts: 11
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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

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

Joined: Oct 14, 2009
Posts: 11
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.
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3219
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.


Java Interview Questions and Answers Blog | Amazon.com profile | Java Interview Books
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

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.
Fabio Falci Rodrigues
Ranch Hand

Joined: Dec 01, 2007
Posts: 36
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.


SCEA5
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

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

Joined: Dec 01, 2007
Posts: 36
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

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

Joined: Dec 01, 2007
Posts: 36
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.
Vladas Razas
Ranch Hand

Joined: Dec 02, 2003
Posts: 385
Try to get Java Web Component Developer Certification, or a book that prepares you for it. Basics are in there.
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
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

Joined: Oct 14, 2009
Posts: 11
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

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
Ranch Hand

Joined: May 31, 2007
Posts: 3219
Start with Servlets and then move to JSPs.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
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.
roger wong
Ranch Hand

Joined: Oct 21, 2009
Posts: 31
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java For Web Development: What should I focus on?
 
Similar Threads
JSP/Servlet VS PHP
JAVA OR COBOL OR RPG OR JSP OR ASP
career advice
Senior Manager, Web Publishing Technology, New York
Offsite or Offshore Java projects or Computer work