aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes How to learn Servlets/JSP/JSF/JEE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to learn Servlets/JSP/JSF/JEE" Watch "How to learn Servlets/JSP/JSF/JEE" New topic
Author

How to learn Servlets/JSP/JSF/JEE

Karol Matysiak
Greenhorn

Joined: Aug 30, 2012
Posts: 20
Hello.

I want to ask YOu how can I learn Servlets/JSP/JSF/JEE ? I already read the "Head First" book about servlets and jsp, but there wasn't any good excercises. Currently im reading the JavaEE tutorial 6 from oracle website, but its still theory with no excercises. I can read every book but I think i will still have no idea how to make an even simple website. I know Java basics (or even little more), and i know theory, do you know any website or book where I could find excercises which will learn me how to really start developing websites? Maybe books are bad and I should try something else ? And btw, do you think that the age of 23 is too late for learning this technologies?

Best regards !
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30894
    
158

Karol,
You will be learning your whole career. Of course 23 isn't too late.

I see a bunch of java servlet exercises online. But you don't really need an exercise. Follow the examples in the book. Try to build a little website on your computer.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61588
    
  67

23? Too old?

I'm well over twice your age (I'll be 55 in a month and a half) and I'm continually learning new technologies!

You're never too old to learn new things.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Karol Matysiak
Greenhorn

Joined: Aug 30, 2012
Posts: 20
Ok but I read a lot and still I don't know from what exactly start. Is it deployment descriptor? Or maybe I should start from creating Java bean ? In the Java EE tutorial 6 from Oracle website, examples are already written, so I see a ready (but very tiny) product, which has all this things. When I look at them I understand the code (mostly of course), but that's it, If someone would come to me and ask me to do the same thing that was in example, I would have a very big problem to write it.

And of course that's nice that I am not too old
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30894
    
158

You might try starting with a book. That way you can see the example get built up slowly.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61588
    
  67

Ignore everything but Servlets and JSP to start. The rest of JEE (which is huge and mostly unused by most developers) can come later. Frameworks like JSF should come much much much later, if at all.
Karol Matysiak
Greenhorn

Joined: Aug 30, 2012
Posts: 20
Bear Bibeault wrote:Ignore everything but Servlets and JSP to start. The rest of JEE (which is huge and mostly unused by most developers) can come later. Frameworks like JSF should come much much much later, if at all.


what do you mean mostly unused? SO making websites or web apps in java is a bad idea? I thought that JEE, and enterprise java beans and jsf are really good.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61588
    
  67

Karol Matysiak wrote:what do you mean mostly unused? SO making websites or web apps in java is a bad idea?

Wow, that's quite a leap! I said that about as much as I said that you should dress in a hula skirt and swing from a ceiling fan.

JEE is vast. Vast! And it has a hodgepodge of technologies that hardly anyone uses a large percentage of. And certainly any single project will only use a handful of them.

Most sites will use just Servlets and JSP, and maybe a few other technologies. And some of those technologies, such as Spring, may not even be part of JEE.

My point is that if you try to eat all of JEE you're going to blow up like the guy who ate one too many thin mints. Start with JSP and Servlets. And when you have a really good handle on that, then, and only then, start looking at other parts of JEE.

I thought that JEE, and enterprise java beans and jsf are really good.

Depends who you ask. Some devos like EJBs. Many do not. Some like JSF, many, myself included, thinks it's an abomination that should never have seen the light of day.

Again: JEE is BIG! Start with the basic foundations.
Karol Matysiak
Greenhorn

Joined: Aug 30, 2012
Posts: 20
Okie, I must agree with you that jee includes many technologies, but jsp and servlets are (from what I have read in head first and jee tutorial) obsolete and now, almost nobody use them to build even simple sites.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61588
    
  67

Karol Matysiak wrote:Okie, I must agree with you that jee includes many technologies, but jsp and servlets are (from what I have read in head first and jee tutorial) obsolete and now, almost nobody use them to build even simple sites.

That is about as far from the truth as anything can be. Almost all Java web technologies build on JSP and Servlets. They are far from "obsolete"! Even if you are not just using JSP and servlets for a web app -- and may devs do -- technologies such as SpringMVC, Struts and even JSF are built upon the foundation of JSP and Servlets.

Who have you been talking to that has filled your head with this nonsense? I was a technical adviser for the Head First book and it says no such thing.
Karol Matysiak
Greenhorn

Joined: Aug 30, 2012
Posts: 20
I just checked HF book and you're right. Maybe I didn't understand what was there written, maybe not whole JSP technology is obsolete, but some parts of it - like scriptlets or declaration. Ok I will try to build some website using only jsp and servlets

thank you
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30894
    
158

Right. Building a website with *just* JSP (and not Servlets) has been horribly obsolete for years. You want to be learning MVC (model view controller) where a servlet calls the JSP for you. That way the logic is not in the JSP.
Karol Matysiak
Greenhorn

Joined: Aug 30, 2012
Posts: 20
I still don't get it what you could do in a servlet ? Most of things you can do in normal java helper class. In servlet of course you can make a lot of "initialization things" like connection to database, but I don't understand what to put there more? For handling request and response?
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3227
Google for some tutorials on Servlets, JSP, etc.

You may need a JEE Web container like Tomcat, JBOss, etc. So, search for tutorials that talk you through Tomcat or JBoss.


500+ Java Interview Questions and Answers | Java job hunting know how & Java resumes
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61588
    
  67

Servlets do all the connecting of the View (JSPs) with the Model. No processing at all should ever be done in a JSP. JSPs are for creating the View only.

If you haven't read the following articles yet, I advise you to do so:
  • The Secret Life of JSPs
  • The Front Man

  • Karol Matysiak
    Greenhorn

    Joined: Aug 30, 2012
    Posts: 20
    Ok so if I understood those articles right...

    JSP pages are jsp files (which are really a servlets) which are responsible for generating html pages. They use EL to get the data from servlets or helper class (java classes).
    In each web app we need a servlet which is responsible for connecting to the model, for example servlet that retrives/updates/deletes data from database. This servlet also puts retrived data in the request.
    Second servlet gets the request and the data which was in it and prepare it for the "final" JSP page. It also redirect (using dispatcher ?) the request to the "final" JSP page.
    Final JSP page gets the data from request and generate dynamic content.

    Am I right?
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61588
        
      67

    On the right track!
    Karol Matysiak
    Greenhorn

    Joined: Aug 30, 2012
    Posts: 20
    ok so one and the last question. I have a jsp page with a form, which is for example registration form ( It should send data (which are of course validating before sending it) . I also have a servlet called DbCon.do which is responsible for connecting to db, and second servlet called PreparePage.do which is responsible for preparing data to the output JSP page and for dispatching the request. And my question is, which element should be in action parameter of the form ? DbCon.do? or PreparePage.do?
    Volodymyr Levytskyi
    Ranch Hand

    Joined: Mar 29, 2012
    Posts: 505
        
        1

    Hello!

    I am your counterpart! I am 23 years old. I have been studying Java since end of 2010. I have my own favorite projects on Java Swing! Half an year ago I completely moved to JavaEE6 and at that time I thought the rightest way to study is with javaee6 tutorial from oracle website. Soon I realised that it was too difficult to understand
    therefore I began to consume one book after another covering everything related to javaEE6. And now I am glad to say that I am at the end of this tutorial. I am going to
    proceed to second case study from chapter 52.
    I know about servlets and jsp almost nothing!

    To my mind the better way to study something is through examples. The more examples you saw the better! The best way - making your own projects, sites!!!
    I decided to build the simplest jms application that allows users to exchange messages( to chat).

    As a result, my big library of books I passed didn't help me to resolve one stupid issue.
    How to display message which has been caught in onMessage() method of MessageListener. I wanted to use 'binding' attribute. I used method UIOutput.setValue() and it doesn't work!

    I advise you to look through big great example at first and then looking at that example built your own site extending it with your new, inspiring ideas.
    I know my any work will give its fruitful results in future!
    I know the more I work and know the better! Anyway people only begrudge to those who know more.


    True person is moral, false is right!
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: How to learn Servlets/JSP/JSF/JEE