This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I've been hoping to try and generate some good discussion in this forum. I had posted an informal survey in another thread trying to get an idea about people's Servlet and JSP knowledge level when they picked up Struts. I got some good answers, but because a lot of the people I was hoping would respond didn't, it didn't really make the point I was hoping to.
Having moderated this forum for awhile, I have made the observation that a lot of people are jumping into Struts without having what I feel is a necessary background in Servlets and JSP. I suspect this is mainly the fault of employers who don't want to spend the time properly developing employees skill sets, but rather just want to get them producing something even if they aren't gaining the fundamentals needed to be as successful as they could be. Aside from employers pressuring developers, I also get the impression that there also exists a subset of people who just want to get Struts added to their resume and are looking to run before they can walk.
It's my belief that an understanding of any web framework, Struts being one of many, is absolutely predicated on a thorough understanding of Servlets and JSP. Servlets and JSP are the foundations on which just about all of these web app frameworks are built, and it's just not reasonable to assume that someone can fully grasp the framework if they don't grasp the foundations.
To re-iterate, in the other thread I asked people which category they fell into:
1. Prior to learning Struts, I was well versed in Servlets and JSP, and had professional experience developing applications using Servlets and JSP.
2. Prior to learning Struts, I had read books about Servlets and JSP (or taken the SCWCD exam), but had no professional experience developing applications using JSP and Servlets.
3. Prior to learning Struts, I had little knowledge concerning Servlets and JSP.
I think a couple quotes from the other thread illustrated the point I was driving at well:
Originally posted by Gregg Bolinger... 3 then 2. I started learning struts then realized I needed more experience with Servlets and JSP. Stopped Struts, got versed in Servlets/JSP then came back to Struts.
Originally posted by Marc Peabody... #2 with failure, then #1 with success.
I tried learning Struts after getting SCWCD when I had very little working experience. I didn't understand it.
I tried learning it again a year later after gaining more professional experience and it made more sense then.
Originally posted by Tim West... 3...I learned Struts, JSP and Servlets all at the same time. I reckon you end up blurring the concepts of each pretty heavily in learning this way - I'm going to go over Servlets and JSP separately as soon as I find a spare few hours
Learning all 3 at the same time is like learning the 'practice' without the 'theory' in any area...I can make stuff work, but I don't really know how it all ties together. Not a nice feeling, I reckon.
So a few questions for people...
- If you are learning Struts but don't have practical experience in JSP and Servlets (that is, you fall into category 3 of the other thread), why?
- If you are in a position to influence younger developers in your organization, is there anything you do to encourage them to learn the fundamentals before jumping into a framework?
- Am I way off base, and in fact there is no problem with learning Struts (or any framework) and then picking up Servlets and JSP as you go?
- Are there any observations you drew from the informal survey?
Thanks to all the people who answered in the other thread. [ July 11, 2005: Message edited by: Jason Menard ]
I put 3, with no explanation, on the other thread. (I'd assumed you were looking for responses not reasons for the responses)
Further, I assumed the point in time to be that moment that I began using Struts, at which time I didn't know Servlets or JSP. HTML, JS, and CSS was the limit of my web-based experience, (maybe the rare applet here and there).
Anyway, here's my Struts Story.
Newly graduated with CS degree, no job, take 'to pay the bills' non-tech position, friend of a friend is hired away from 'intership', interview, accept, I have a programming job
I'm pretty sure my job doesn't describe an internship as I am immediately responsible for the HR website and all HR web development work occuring...and my direct reports are limited to...me. Not bad for an intern in 40K employee division of a massive corporation.
So, on his way out the door, my predecessor mentions that he's been working with Struts on his latest project and I should check it out.
Assuming that my firm grasp on Java would lead the way to Struts excellence, I dove into the nearest book and began to read.
A week later I'd learned that my firm grasp was more like a vague idea and that Struts was the most convoluted thing I'd ever seen in my life.
After the week spent reading, I began looking at the emails that were coming in complaining about how this app or that feature wasn't working and realized, after some code examination, that: I didn't understand how servlets worked, my predecessor had had a vague idea of how they worked, and wasn't a terribly good programmer. (much of his code seemed to ask "Methods? Bah, why bother with that when I can just copy and paste?")
I spent a good while with my mentor, again: me, and we/I decided that I should read the servlets and jsp books my thoughtful predecessor had left behind, fix the servlet problems being reported, thereby learning something about servlets and jsp in the process, then get back to Struts and the new development work.
After a month I had the first app back up, after 3 months I had all 5 apps back up, after 6 months I had the Struts app up (A Project Management application for engineering, 6 page 'wizard' record interface, with file uploading, automatic emails, LDAP integration, role based interfaces, etc...it would take an additional 12 months to finish all the 'can it do this?' requests, all those books and they never once mentioned the perils of scope creep )
So...I'd say I'm really a 2. In fact, even if you attempted to learn Struts with being a 3 in mind, you would still be a 2 because there is no way to learn to write without learning the letters first.
Joined: Nov 09, 2000
Originally posted by Ray Stojonic: So...I'd say I'm really a 2. In fact, even if you attempted to learn Struts with being a 3 in mind, you would still be a 2 because there is no way to learn to write without learning the letters first.
But I think that some people are doing just that, whether by choice or by being put into such a position by their employer. I have no problem answering basic questions about the Servlet API, but when someone doesn't yet have a handle on Servlet basics such as the use of the HttpServletRequest and HttpSession objects for example, then the question begs asking what are the circumstances that made one pick up Struts.
I think this walking before we can crawl thing shows up in another aspect, which is a fundamental confusion as to what Struts is. Often we will see people wondering whether or not you can "do X with Struts", where X is something like generating a PDF view or whatever. To me this exhibits a more basic misunderstanding on what the role of an application framework is in general, and what the role of Struts is in particular. I would hazard a guess that many these types of misunderstandings stem from a more basic lack of understanding conerning Servlets and JSP since the answer to almost all of these questions is if you can do it with a Servlet, you can do it with Struts.
My story, I worked with applets and lot of static stuff. However i decided to work on my Masters and once I was done I had some servlet "experience" under my belt but maybe not good enough to work on professional apps. Got a job, and the first thing i needed to do was learn struts ( i had some exposure to the MVC framework). anyways i read books, worked on tutorials and got an idea abt struts. But your struts app is as good as your servlet knowledge. I know cause there were so many things you could do and understand when you knew your servlets better. So i had to stop struts and started improving my servlets( these were very long nights with very little sleep and a lot of caffeine)
Right now, I'm not even a mid-level struts developer, but im working at it.
Now i see, the new recruits ( i'm talkin, fresh from college) who have no servlet introduction, have to take over the app I have been building. I'm supposed to be mentoring them and the first thing I got them doing was read up on servlets & jsp's only.
But the manager has them down for completing pages by july 22!!! . what are they gonna do, listen to me and read about servlets or copy/paste actions and jsp's, so they make their deadline and keep their jobs. My guess, the later.
I don't like it a bit, but what is a junior developer to do.
3 may work, it didn't for me. I remember taking a look at STRUTS after working through some chapters of Java Servlet Programming. But I found it hard to SEE how it actually worked. I actually found that there was nothing I could learn from STRUTS at that stage. Looking back, I really find it funny that I tried it.
What can a controller do if you have nothing to control?
Now I know lot more about Servlets and JSP, and all those nights spent on SCWCD forum, Tomcat Bugzilla and wading through Tomcat source code are finally paying off. I spent an entire day trying to make a Hello World custom tag work. STRUTS looks glorious now. Learning a better way to do things is indeed fun.
Joined: Aug 16, 2004
Sorry for the irrelevance of this post to your question. But I just realized I know how you look. I have your photograph in my HF Design Patterns book. Infact I know how a lot of bartenders here on the ranch look like.
i am new to struts & i am facing a problem. the application goes to the .do file which is blank. Can anyone help. this is my code. struts-config <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
I think LLL implied a fourth option - "None of the above, I asked Javaranch to learn them all for me"
My answers to Jason's questions, though:
Why I learned Struts before JSP/Servlets
When I first started with Struts I was an intern at a big ol' company, working on a J2EE development project. A fairly well-formed framework was in place, so I could copy what was there, hardly learning much about Struts itself, let alone the others. This is certainly not my preferred way to work, but there were no learning resources made available to me on JSP/servlets (resources = books, courses, time), but I did get a Struts book by chance. Basically, it came down to needing to know Struts now, and happening to have the right book for it. I certainly don't think this is a good way to learn it all, though.
This year, as part of my thesis, I needed a small demonstrative Web app, and so used Struts by default, since it was what I was most familiar with. Again, I was/am pushed for time. I was forced to learn a small amount about servlets when I set up Struts ("hmm, the book says I need this snippet of XML in web.xml relating to 'StrutsActionServlet'"), but still nothing serious.
I've found that my (lack of) knowledge has been adequate for these two scenarios: one where others did the difficult plumbing, and the other where there was very little plumbing to do - my research app has no security, minimal session handling, etc etc. However, I'm fully aware that I am still largely unable to architect a respectable solution that incorporated Struts/JSP/servlets, security, etc. While I could make a solution work, I wouldn't be able to give reasoned arguments as to why it was like it was, etc, if a suitably knowledgable person were to criticise my design.
On junior developers
Regarding junior developers (i.e., me last year), it's a little tough - learning style differs from person to person. For me, I reckon the ideal would have been to work on the application for a while, then have some time set aside for learning fundamentals, ideally as part of a course (perhaps leading to SCWCD or similar). The course could have been part time while I was developing.
That's an ideal situation, mind - the company I was with wasn't willing to do that sort of thing. As a second option, a few decent books and some time set aside for study would have been great.
On learning Struts before JSP/Servlets
IMO, there is nothing wrong with learning Struts before JSP/Servlets, but there is definitely a problem if you fail to ever learn the latter. I reckon some people will shy away from the theory, while others will be keen to understand what's really going on. That stands for virtually any area - I noticed this when tutoring at uni.
Where there is a problem is learning Struts before you have a reasonably clear picture of Java/J2EE and what each vague area does. When I learned Struts, I already had a decent idea of EJB, the three teir architecture, and the purpose of Struts within the general scheme of J2EE applications. People that ask stuff about struts and PDF like Jason wrote (another I've seen is "Connecting to MySQL with Struts") are lacking in much more than JSP/Servlets knowledge - they have no real idea of application architecture at all!
Anyway, my $0.02...And now, I have a thesis to work on!
-Tim [ July 12, 2005: Message edited by: Tim West ]
Joined: Jul 11, 2005
can anyone help me in figuring out the error
Joined: Mar 15, 2004
On the subject of "overall J2EE architecture" being (perhaps) the most important area for people new to web development to understand, here is another post reflecting confusion as to the role of JSP/Servlets themselves - even before Struts is introduced.
"LLL LLL", if you want a meaningful response to your question, I'd post it as a separate topic. This thread is not really the right place. You might want to check the Javaranch username guidelines, which disallow 'obviously fake' names. Finally, if you want people to take your question seriously, it's worth taking the time show that you take it seriously - by writing it in correctly spelt and punctuated English.
-Tim [ July 12, 2005: Message edited by: Tim West ]
To take this further, I think a lot of folks try learning JSP/Servlets (or Struts) before learning basic HTTP and HTML concepts. So often people don't understand how a basic webapp functions nor do they understand its limitations.
Servlets made dynamic html pages easier. JSPs made view-centric Servlets easier. Struts made organizing JSPs and Servlets easier.
Struts solves some problems but it is hard to understand how it works without understanding the problems that it solves. And it's hard to understand the problems without the frustrating experience of trying to solve them on your own.
This is one of the reasons why I'm excited about JSF, as it seems to make the basic webapp concepts very transparent to the developer. I think the initial learning curve will still be close to that of Struts but the curve will take more of a Swing-like (and dare I say cleaner) approach.
A good workman is known by his tools.
Joined: Mar 15, 2004
Marc - what you observe certainly rings true for me! (Not my own learning path, but what I've observed in others).
Another issue that's related is "learning" use of Java and libraries through a tool - usually a modern IDE. I'm motivated by a question in this thread, namely "How can I add Struts capabilities without a Struts plugin?" Here, the concept of Struts is blurred with that of a tool that helps you write a Struts application. This is separate from the blurring between Struts/JSP/servlets/HTTP etc - and perhaps more fundamental than it.
It seems to me that a possible, bad, (common?) path for learning Java web app development is:
First, learn Java using an IDE. Overlook many concepts that the IDE helps you around, and fail to get a strong understanding of Java concepts For example, a user won't ask "what's a JAR?" but will say "The export JAR function in Eclipse won't work"***, or "How can I make an .exe with Netbeans?"
Second, build a Web app using an IDE. The IDE generates all sorts of XML files, WARs, and automatically sets up Struts.
For the moment I just wanted to point out this related problem...the solution? I dunno - make them use vi?!
*** Note, a very real question on Eclipse JAR export was posted recently, and this was certainly a legitimate question. I'm not getting at this sort of question, rather at questions that demonstrate a lack of clear separation between "JAR" and "Eclipse's JAR export function". [ July 12, 2005: Message edited by: Tim West ]
Joined: Nov 09, 2000
Good point Tim. I think it's the whole thing with people wanting to run before they learn how to walk which I mentioned in the first post. While I'm sure that job demands are a big part of this, I get the impression that all too often this kind of thing is self-inflicted.
I recognise everything Marc and Tim have written here. Many of the questions posted stem from a fundamental lack of understanding about how Java works, hpw the web container works, and how HTTP communication works.
An example I'd like to chip in on my own is the JFreeChart forum where (awhile back at least) one or two times a week someone would ask why the java.awt.Image he <%='d into his JSP page didn't show up.
The question now, of course, is how do we get the world at large to spend a few weeks with a text editor and javac before firing up an IDE? [ July 24, 2005: Message edited by: Barend Garvelink ]