This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Servlets and the fly likes Comparision between Servlet & JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Comparision between Servlet & JSP" Watch "Comparision between Servlet & JSP" New topic

Comparision between Servlet & JSP

Devang B patel

Joined: Oct 20, 2000
Posts: 6
Hello Friends!!!
I have just started Servlet before 20 days. I have read some introduction part of JSP also. But I want to ask u one question that Should I spend much time on Servlet or after some work in servlet I should start learing JSP... Because as I heard JSP is very easy and much used in Markt... So could U please focus on it! I will thankful if u will give me proper reply...
Raj Kumar Gopal

Joined: Oct 20, 2000
Posts: 6
Learn Servlets first. JSP is a Servlet!!. If you know Servlets, Session Management and some important methods in Servlet API, then u can move to JSP. At that time JSP would be easy to learn.
shailesh sonavadekar
Ranch Hand

Joined: Oct 12, 2000
Posts: 1874
i agree with Rajkumar. You have to get your fundametals concrete in the Servlets. You have to see how servlet works ? What is generic servlet ? what is httpservlet? Why certain things happen in certain ways in Servlets ? Things like servlet chaining , URL rewriting etc. to be thoroughly done.Get complete hang of that. & then go for JSP.
Jsp sits on servlet. Internally servlet code is generated when the jsp page is invokeed. If you are not familiar with the servlet fundamentals of servlets , then your knowledge of jsp will be shallow.
bye & regards. I hope this is helpful to you.
Devang B patel

Joined: Oct 20, 2000
Posts: 6
Hello Raj kumar & Shailesh!!!
Thanks for reply...
I understood what u want to say... I really appreciate ur suggestion. I think I will be comfortable with servlets after finishing online shopping mall project which I am doing rightnow with my friends... I want to ask u one more question. Is it possible to use servlets & JSP both in my project. If yes then where I can use servlet & where can I use JSP... I know ASP very well so I think to learn JSP It willnot take long time... I know some fundamental of JSP also... So could U please reply me....
Thank again... for ur proper reply...
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Use Servlets as controller. Basically servlets are the brain of a web application. It is the one which gets the request from user, recognizes what the user asks for, checks if all the inputs are given correctly, if everything ok, then choose the correct business logic class to get the needed info for the request from the user, and then decides which page to route to. So from the work it does we can very well call it as a controller.
Use jsps for the presentation part. Jsps are more html, less java/jsp code. Try to reduce the jsp/java code in the jsp pages. Design you application using M0del-View-Control design pattern.
maha anna
[This message has been edited by maha anna (edited October 21, 2000).]
I agree. Here's the link:
subject: Comparision between Servlet & JSP
It's not a secret anymore!