• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to learn Servlets/JSP/JSF/JEE

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Karol Matysiak
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might try starting with a book. That way you can see the example get built up slowly.
 
Bear Bibeault
Sheriff
Posts: 67747
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
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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Sheriff
Posts: 67747
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

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

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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Author
Posts: 3473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Sheriff
Posts: 67747
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
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
    Posts: 20
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
    Sheriff
    Posts: 67747
    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
    On the right track!
     
    Karol Matysiak
    Greenhorn
    Posts: 20
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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?
     
    Ranch Hand
    Posts: 514
    1
    Eclipse IDE Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic