wood burning stoves 2.0*
The moose likes Servlets and the fly likes Is it worth learning a web framework when starting to learn web programming? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Is it worth learning a web framework when starting to learn web programming?" Watch "Is it worth learning a web framework when starting to learn web programming?" New topic
Author

Is it worth learning a web framework when starting to learn web programming?

Alan Smith
Ranch Hand

Joined: Oct 19, 2011
Posts: 162

Hi all,

I am just curious as to what is the "experts" opinion here on Javaranch about learning web frameworks. I started to learn web programming using Head First JSP & Servlets (JSP, JSTL and Servlets) and thought I might go ahead and look at a web framework. I have not dug into any framework in depth, just followed some tutorials and documentation. I thought Struts was quite useful but then I read about it compared to other frameworks; its apparently outdated. I then moved onto Grails and for all the wonderful things said about it, the tutorials I followed had GSP scriplets embedded in HTML pages. I have read some articles (and been told on this forum) not to use scriplets. Ever! I have been using JSTL in my JSP pages instead of scriptlets since I started learning. Although I am still learning Grails, its method of page layout confuses the he!! out of me. JSF is a complete nightmare, I really don't see like the fact that it wraps standard HTML in its own tags. I plan on looking at Spring next.

In a nutshell, is there anything wrong with sticking with trusty old HTML (with JSTL), CSS, Servlets, Hibernate (which is awesome by the way) for ORM, for learning web development or should I really get to grips with one of the frameworks? I just feel that I have more control (for want of a better word) without a framework.

ps. I didn't post this in the 'frameworks' section as I would like to hear from experienced programmers who know servlets and frameworks. The frameworks guys/girls will probably say yes, use a framework!

Thanks,
Alan
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

In my opinion, it's not only worth learning a web framework but several ones.
Let start some reading, coding, experimenting... and you will have your answers.


PM Me If You Want to get Urgent Help on Java Programming
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

This thread has the potential to turn into a framework flamewar so I would caution everyone to be aware of that and construct your responses accordingly.

My simple answer to this question is it is imperative that you understand Servlets and JSPs at a fundamental level regardless of using a framework. Nearly every Java web framework worth anything is built on the JEE API. The decision to stick with Servlets and JSPs versus using a framework is really up to a lot of different factors. In my opinion there are some frameworks that will make your life a lot simpler.

So the answer is there isn't really anything wrong with staying low level. I personally love Grails. Other folks love Struts or SpringMVC. Learn the basics, then play around with some frameworks and decide for yourself what works best for you and your projects.


GenRocket - Experts at Building Test Data
Dhaval J. Patel
Ranch Hand

Joined: Mar 10, 2011
Posts: 90

Hi Alan

Personally I would suggest getting a solid idea on why frameworks are used. Once you have a good idea on that you will understand how it makes your life easy. Then see what framework you want to learn. If you feel you get more control using base technologies, I guess it wont be a choice once you start working for a company that uses frameworks. It all depends on what you are working on and what the implementation needs. Yes, I agree that using trusty old stuff gives you more control, but its a matter of whether you need that control or not. If you do not need that control then it ends up being an overhead. I am not a framework fanatic, I came through the same path you came (learning base first). But I do feel that learning framework is a definite plus. If you do not learn one now, I guarantee you will end up learning and working with one anyways.

All the best
Alan Smith
Ranch Hand

Joined: Oct 19, 2011
Posts: 162

Thanks for the responses.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61448
    
  67

Gregg Bolinger wrote:My simple answer to this question is it is imperative that you understand Servlets and JSPs at a fundamental level regardless of using a framework.

Quoted for emphasis.

All too often people dive off into a framework before understanding the fundamentals, and then they get into trouble really really fast. Make sure that you understand the fundamentals of servlets and JSP before taking on a framework.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
Beginners should stay clear of frameworks as long as possible. Work through examples using a text editor and compiling from the command line until you are comfortable with all the basic parts and the typical error messages.

Bill
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
In my opinion, at beginner level one should try to learn the fundamentals as everyone agreed . Also, try to implement ideas such as MVC using basic jsp, servlet. It is then that one would understand the effort required and the need for frameworks.


Programming is about thinking, NOT coding
Michael A Hoffman
Ranch Hand

Joined: Mar 04, 2009
Posts: 37

A lot depends on who you are and what your end goal is. Companies are hiring today based on your specialized knowledge of a framework or product. If you are looking for a job in a short timeframe, learn the web framework first and go through the pain of figuring out the underlying API as you go along. The pains come later in the project when you run into things you don't understand, but depending on the team, you may get the support you will need. If you have some time, I would follow one of the previous recommendations, which is to learn the API in conjunction with looking at how the various web frameworks implement it and/or extend it. Frameworks are put into place with the goal of minimizing re-development of common patterns, supporting reuse, better support, etc. Inevitably, you will need to figure out something like why Spring MVC is not binding the data from your form and have to delve into the API. Do you have to be an expert in JSPs and Servlets? No. Just know enough that you will be able to recognize the concepts when needed. The forums will not always have a direct answer for your question.

When I jumped into the industry back in 1998, there were no web frameworks. I and my team developed our own framework components, including a struts-like web framework, an authentication framework, etc. Knowing the Servlet API well (JSPs didn't become popular until later), I was able to provide extensions that simplified programming and helped immensely as I went along in my career. Interestingly enough, I feel I know a lot less about Servlets today because Spring MVC has hidden much of the complexities away; however, I just need to quickly browse a JavaDoc to jog my memory on a concept.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Michael A Hoffman wrote:If you are looking for a job in a short timeframe, learn the web framework first and go through the pain of figuring out the underlying API as you go along. The pains come later in the project when you run into things you don't understand, but depending on the team, you may get the support you will need.


As long as you are upfront with the potential employer about your knowledge. Personally, I'd never hire someone without a basic understanding of the Servlet and JSP spec. I'd rather train someone on a framework. Not the other way around.

Michael A Hoffman
Ranch Hand

Joined: Mar 04, 2009
Posts: 37

Gregg Bolinger wrote:
Michael A Hoffman wrote:If you are looking for a job in a short timeframe, learn the web framework first and go through the pain of figuring out the underlying API as you go along. The pains come later in the project when you run into things you don't understand, but depending on the team, you may get the support you will need.


As long as you are upfront with the potential employer about your knowledge. Personally, I'd never hire someone without a basic understanding of the Servlet and JSP spec. I'd rather train someone on a framework. Not the other way around.



Agreed with being upfront. I see a lot of potential candidates who are selling themselves as a Spring expert; however, they don't have the basic knowledge. I was simply implying some places may still be willing to hire you if you have some of the understanding of the framework as there may be training and support available to get the underlying understanding of the API, such as if you are junior developer going into a consulting firm. A lot depends, of course, on the quality of programmer you are, etc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it worth learning a web framework when starting to learn web programming?