Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > JAVA Technologies
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 14-02-06, 02:05 PM   #1 (permalink)
Member
 
Join Date: Feb 2006
Location: India
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4 aparna3032 has disabled reputation


Friends This is Java Interview Question asked by TCS,Pune :


Q.) Ican do every thing in jsp itself,then what is the need of servlet?





Please reply.


Aparna.



aparna3032 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 15-02-06, 04:54 AM   #2 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello



JSP pages are focused
around HTML (or XML) with Java codes and JSP tags inside them. When a web
server that has JSP support is asked for a JSP page, it checks to see if it has
already compiled the page into a servlet. Thus, JSP pages become servlets and
are transformed into pure Java and then compiled, loaded into the server and
executed.






JSP pages are focused
a round HTML (or XML) with Java codes and JSP tags inside them. When a web
server that has JSP support is asked for a JSP page, it checks to see if it has
already compiled the page into a servlet. Thus, JSP pages become servlets and
are transformed into pure Java and then compiled, loaded into the server and
executed.

Servlets are modules that
extend request/response-oriented servers, such as java-enabled web servers. For
example, a servlet might be responsible for taking data in an HTML order-entry
form and applying the business logic used to update a company’s order database.






Each Servlet has the same
life cycle: a) A server loads and initializes the servlet by init () method. b)
The servlet handles zero or more client’s requests through service() method. c)
The server removes the servlet through destroy() method.



__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 15-02-06, 01:36 PM   #3 (permalink)
Member
 
Join Date: Feb 2006
Location: India
Posts: 45
Thanks: 0
Thanked 2 Times in 2 Posts
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 3 solletilakshmi has disabled reputation


Ican do every thing in jsp itself,then what is the need of servlet?


hi aparna


Jsp's are based on servlet technology means jsps are nothing but servlets.when we write a JSP and is deployed on a webcontainer the webcontainer internally uses a jspc(jsp compiler) and generates a .java class(which is nothing but a servlet).


Coming to the point of why to use servlets when we have jsps.


1) In the above paragraph as i have said that a jsp will be ultimatly converted as a servlet .The webcontainer need to spend some amount of time for doing itwhich reduces the performance of the webcontainer.So when have to write lot of java code in order to improve the performance we should use servlets.


2) When the jsps are compiled to .java files a lot of code will be generated whether it is necessary or not to have the required code we can go with servlets.


3) with jsps we need not write lot of code as the necessary code will be generated my the web container there by making the developer to easily develop the applications who has minimum amount of knowledge.


4) A person without any knowledge of java can complete the task with jsps as jsps uses html.So a person without any knowledge of java can be handled the task of developing the screens and a java developer can be involved in developing the java related stuff.As a result the project development will be done in less amount of time.


5) A java developer will charge more amount of money compared to a html developer.








JSP are built using html .A developer who has no idea about coding in java can use jsps.So during the development of real time project the work load can be distributed


solletilakshmi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +6.5. The time now is 02:44 AM.





Search Engine Optimization by vBSEO 3.1.0