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 JSP and the fly likes JSP where to start? 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 » Java » JSP
Bookmark "JSP where to start?" Watch "JSP where to start?" New topic
Author

JSP where to start?

Irtiza Ali
Greenhorn

Joined: Nov 27, 2009
Posts: 21
I really don't know if this is the right place for my topic but I am posting it. I really need help in it.

I am trying to learn few technologies. I am currently in JSP. I had planned to go like after core java JSP, servlets, struts, hibernate. I am currently in JSP.

Now I want to know if Custom tags is an important topic to cover or not? & If I can have good links or tutorials to it that will help. Do I really need to go in depth of everything in JSP or I can move forward to servlets & struts???

thanks

Irtiza

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Welcome to the Ranch.

Irtiza Ali wrote:Now I want to know if Custom tags is an important topic to cover or not?

Absolutely. Extending the capabilities of JSP with custom tags and other elements such as EL functions is a important part of writing modern JSP pages.

But... before you dive off into those subjects you should have a very firm grasp of basic JSP concepts such as scoped variables, the Expression Language (EL), and the JSTL (JSP Standard Tag Library).

Be sure to avoid antiquated and discredited scriptlets.

or I can move forward to servlets

You are doing it in the wrong order. Before learning JSP you should have a good grasp of Servlets. Without Servlets to serve as a JSP controller, you have no hope of writing good and modern JSP pages.

struts?

Avoid frameworks such as Struts until you have a firm grasp of all Servlet and JSP concepts.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Irtiza Ali
Greenhorn

Joined: Nov 27, 2009
Posts: 21
Ok.

I am sorry but I have a book of JSP from O'reilly in which servlets is after JSP.

anyways thanks. will be then going through the servlets first. Also Can anyone suggest me any books on servlets??

Irtiza
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

It's OK to learn them side-by-side, or soon after one another. Just be aware that JSPs can't stand alone without servlets.

The usual problem with learning JSP before servlets is that it usually trains you to put Java code into your JSP which is a very, very, very (and did I say very) bad practice.
Irtiza Ali
Greenhorn

Joined: Nov 27, 2009
Posts: 21
Ok

& both technologies are important right? I mean what I have browsed is that JSp is basically for the front end development. so what is actually done by servlets???& when ppl say this so do they mean front end development as what the web designers do because they also develop the front end.

Irtiza
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Irtiza Ali wrote:& when ppl say this

Please use real words when posting to the forums. Abbreviations such as "ppl" in place of "people" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

both technologies are important right?

Absolutely. Both are an imperative part of modern web applications that work together.

I mean what I have browsed is that JSp is basically for the front end development. so what is actually done by servlets?

JSPs provide the "view", servlets provide processing and control. Almost every request should go to a servlet (called a "controller") first that does the work of the request, and then forwards to a JSP to provide the view.

so do they mean front end development as what the web designers do because they also develop the front end.

"Front end development" can mean just about anything. It could mean only client-side development (HTML and JavaScript), or it could mean only the views, or it could mean anything above the business layer (which is how I usually use the term).
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Here are a few articles that may be of help:

The Secret Life of JSPs

The Front Man
Irtiza Ali
Greenhorn

Joined: Nov 27, 2009
Posts: 21
Ok

I did understand the secret life of JSP's but couldn't understand the other one.

Also as in the other article your saying that we should not use java code in between the jsp code....then how will be connect through database & secondly why on earth every JSP book & every tutorial teaches us to use embed java through scriplet???

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Irtiza Ali wrote:I did understand the secret life of JSP's but couldn't understand the other one.

What parts are you having problems with? The article outlines the reasons that modern best practices are the way that they are, and while a deep understanding may not be necessary at this point (you can always review it later), it's rather important to understand the premise.

Also as in the other article your saying that we should not use java code in between the jsp code....then how will be connect through database

That is the purpose of the Java classes that make up the rest of the application. The concept of Separation of Conerns says that everything should be in its proper place. DB code has no place anywhere near the UI, let alone in the view.

secondly why on earth every JSP book & every tutorial teaches us to use embed java through scriplet?

Because they're old. If you find older books on TV repair, they'll be talking about tubes not electronics. Times change and technology moves forward.
Irtiza Ali
Greenhorn

Joined: Nov 27, 2009
Posts: 21
What parts are you having problems with?


the refresh button issue & PRG pattern...also that I though when I ll implement any website for my practicing then I ll get to know it.

Please sir can you give me any tutorials or links for new JSP books???because the book which I have is O'reilly JSP dec 2003.

And before that I have to learn servlets so if I can have any good updated link for servlets because whatever I am getting right now is books from 2001.


That is the purpose of the Java classes that make up the rest of the application.


so when you mean java classes you mean servlets right???because I was reading in an old article that Servlets are classes. Also can you tell rather confirm this from what I have gone through all this that in a web application if which I ll make just for my practice using servlets & jsps...the JSP will just do nothing except what you have written in the "secret life of JSP's" i.e. only a little bit of front end. & the servlets will do all the connectivity from the database.& the bean classes will have the data.

Thanks

Irtiza


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Irtiza Ali wrote:the refresh button issue & PRG pattern..

While those are important patterns, they're the type of thing you can come back to. The real important concepts to take away from the article is the proper layering of web applications between view, controller and model.

Patterns like PRG and Front Controller can come as they make sense.

Please sir can you give me any tutorials or links for new JSP books???because the book which I have is O'reilly JSP dec 2003.

Wow. 2003 is ancient.

The Head First Servlets and JSP book is a good one.

When it comes to scriptlets, it's ok to learn about them as you may come across older code that still uses them, but you should never use them in new code. It'd be like trying to put tubes in a modern TV.

And before that I have to learn servlets so if I can have any good updated link for servlets because whatever I am getting right now is books from 2001.

The Head First book covers both.

Also be aware that servlets, while undergoing some modernization, haven't changed anywhere near as much as JSP (which underwent a major shift away from scriptlets).

so when you mean java classes you mean servlets right?

Not necessarily. The servlets serve as UI controllers, but model code (including areas like business logic and persistence) should be arranged in classes that have nothing at all to do with presentation. That keeps your code as clean and flexible as possible.

because I was reading in an old article that Servlets are classes.

Yes, servlets are classes. But they are far from the only types of classes that you will find in web applications.

Also can you tell rather confirm this from what I have gone through all this that in a web application if which I ll make just for my practice using servlets & jsps...the JSP will just do nothing except what you have written in the "secret life of JSP's" i.e. only a little bit of front end. & the servlets will do all the connectivity from the database.& the bean classes will have the data.

That's pretty close -- but the servlets shouldn't do too much work themselves -- rather they control and delegate. Your application's logic and persistence should be in classes that have nothing to do with servlets or JSPs or other UI elements.

That not only makes the application logic clean and flexible, it also makes it much easier to test.


Pradip Bhattacharya
Greenhorn

Joined: Dec 05, 2008
Posts: 23
Hi Irtiza,

I learnt Servlets and JSP from Head First Servlets & JSP. Its a great book. Trust me you will love this book.


Pradip.B
Irtiza Ali
Greenhorn

Joined: Nov 27, 2009
Posts: 21
Thanks Sir

so servlets(java classes) are different from all the logic & code in the bean classes or logic building classes.

now if I have to make an e.g web application how will I divide things into servlets JSP's & business logic & database classes.? any articles on this?

thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Look up terms such as DAO, Model 2, MVC, n-tier, and so on.
Irtiza Ali
Greenhorn

Joined: Nov 27, 2009
Posts: 21
yes I know about MVC 2. Its implemented in the struts framework.

It is possible to make an application using only servlets & jsp???

Irtiza
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Irtiza Ali wrote:It is possible to make an application using only servlets & jsp?

Sure, but it won't be a good one.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Irtiza Ali wrote:yes I know about MVC 2.

There's no such thing as MVC 2 -- just MVC.

And if you know about MVC, then you know that control (C) is what servlets provide, and persistence (DB access) is part of the model (M) which is a completely separate layer from servlets.
Irtiza Ali
Greenhorn

Joined: Nov 27, 2009
Posts: 21
Ohh

this means I have to study servlets then the remaining of JSP & then struts & then my first practice application ...5 days at least..

thanks Sir

will be asking questions on servlets from now on.

Irtiza Ali
Greenhorn

Joined: Nov 27, 2009
Posts: 21
http://www.theserverside.com/discussions/thread.tss?thread_id=20685 ???
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Irtiza Ali wrote:this means I have to study servlets then the remaining of JSP & then struts & then my first practice application

As I said earlier, I'd avoid frameworks like Struts until you have a very good grasp of the basics. (And even then, I am not a fan of the big frameworks.)
Irtiza Ali
Greenhorn

Joined: Nov 27, 2009
Posts: 21
Yup as I wrote that I ll first finish servlets & JSP's so that I can move to a framework so that I can practice my first web application using all the today's standards.

secondly if frameworks are not good & we cannot make a good application only using servlets & JSP's then what to use???

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

I personally find that the big frameworks try to do too much and to be too general, and, for me, just create more work than they save.

Once you have a good grasp of the core technologies, you will be in a position to make that determination for yourself.
 
wood burning stoves
 
subject: JSP where to start?
 
Similar Threads
Suggest a book please
Relevance of SCWCD
EJB or SPRING????
Help in Learning Advanced JAVA
Question for "Struts 2 Design and Programming: A Tutorial"