Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comparision between Servlet & JSP

 
Devang B patel
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
Thanks!!!
 
Raj Kumar Gopal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
FIRST SERVLETS ...then JSP!!!
 
shailesh sonavadekar
Ranch Hand
Posts: 1874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Devang,
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.
regds
maha anna
[This message has been edited by maha anna (edited October 21, 2000).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic