GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE
Go To First  |  Previous Question  |  Next Question 
 J2EE  |  Question 62 of 104    Print  
Servlet Request Object
What is difference b/w WITH ServletRequest Object:................RequestDispatcher rd = getServletContext().getRequestDispatcher( "/servlet/XYZServlet"); rd.forward(request, response);with ServletContext Object:.......... RequestDispatcher rd = getServletContext().getRequestDispatcher( "/servlet/XYZServlet"); rd.forward(request, response);what is difference b/w these two objects?which one is better or advatageous?any help would be appreciated.with regards,santh


  
Total Answers and Comments: 2 Last Update: October 31, 2006     Asked by: santh kumar 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 16, 2006 22:52:48   #1  
Spoorthi        

RE: What is difference b/w WITH Ser...

If we use ServletRequest object then we have to give only the servlet name.

For ServletContext object we have to give the relative path i.e in a context we have more than servlet instances. so we have to give the path from context level.


 
Is this answer useful? Yes | No
October 31, 2006 09:03:31   #2  
ajaykjha Member Since: October 2006   Contribution: 12    

RE: What is difference b/w WITH Ser...
In case of ServletRequest we provide the path relative to http request while in the case of ServletContext we provide path relative to root of context.
 
Is this answer useful? Yes | No

 Related Questions

What is the right way of writing the code to get the servlet information using public String getServletInfo()?
Read Answers (4) | Asked by : subhashree

Latest Answer : Struts created internal objects are simple class objects so does not support the all the features provided by ejb container such as transaction managment,persistancy,Security features ,Connection pooling etc. ...
Read Answers (1) | Asked by : sanjay sharma

Latest Answer : OBJECTS SIT ON HEAPPRIMITIVES (LIKE INT, DOUBLE ETC) SIT ON STACKSTACK IS FASTER THAN HEAP.OBJECTS ARE PASSED BY REFERENCE.  PRIMITIVES ARE PASSED BY VALUE.OBJECTS ARE GARBAGE COLLECTED.  PRIMITIVES ARE CLEARED FROM THE STACK BY MOVING THE STACK ...

1. Some websites will have hierarchical display of items. (For eg, on click of a ‘+’ symbol, all items under this item gets listed.). How do you store such structure in database (Note: You can store as XML object. But how do you store in database tables without using XML) ?2. explain 3GL ?
Read Answers (3) | Asked by : ronin

Suppose there are 2500 records to be handled? How Data Access Object (DAO) class will handle it?  
Latest Answer : DAO is one of design patterns. The Data Access Object (or DAO) pattern: 1. Separates a data resource's client interface from its data access mechanisms, 2. adapts a specific data resource's access API to a generic client interface. The ...
Read Answers (2) | Asked by : Anoop

When the processing is going in the backend systems(database) and the communication is from the browser through servlet, what wil happen when the browser is closed?

Latest Answer : I like u r answer, it contains everything in this answer. ...
Read Answers (7) | Asked by : MKP

What is difference b/w WITH ServletRequest Object:................RequestDispatcher rd = getServletContext().getRequestDispatcher( "/servlet/XYZServlet"); rd.forward(request, response);with ServletContext 
Latest Answer : In case of ServletRequest, we provide the path relative to http request while in the case of ServletContext we provide path relative to root of context. ...
Read Answers (2) | Asked by : santh kumar

There are 4 domain sever and 4 web application running in a system. A client is acessing all web application at a time. How many servlet context will be created? 
Latest Answer : can have 4 servlet context. as u have 4 web server and this is a distributed application ...

What is initial context point for handling web request in page centric architecture? Is it Jsp page or servlet
Read Answers (1) | Asked by : tvkmcalb


 Sponsored Links

 
Related Articles

ODP.NET - OracleCommand Object

ODP NET More About the OracleCommand Object Till now we have seen OracleCommand working with OracleDataReader OracleCommand is not simply meant for OracleDataReader It has got a lot of functionality for itself Let us see few of the most commonly used features of OracleCommand in this section We will
 

Microsoft AJAX Library - Creating Object Members on the Fly

Creating Object Members on the Fly One major difference between OOP in C and ASP NET and OOP in JavaScript is that JavaScript allows creating object members on the fly" This is true for objects and classes that you create yourself and also for JavaScript s own objects and types as well He
 

Microsoft AJAX Library - Object-Oriented JavaScript

Object Oriented JavaScript Objects and classes are implemented differently in JavaScript than in languages such as C VB NET Java or C However when it comes to using them you ll feel on familiar ground You create objects using the new operator and you call their methods or access their fields using t
 

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

Object-Oriented Client-Server Internet

Object Oriented Client Server Internet OCSI Environments as IT Infrastructure Client Server Basics Object Oriented Client Server Internet OCSI environments provide the IT infrastructure for supporting OCSI applications For our purposes infrastructure refers to operating systems networks middleware
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

JavaScript Date Object

JavaScript Date Object In this JavaScript tutorial you will learn about date object and methods of date object explained along with syntax and example mosgoogle center JavaScript Date Object Usage of Date Object Date object of Java Script is used to work with date and times General syntax for defini
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

JavaScript Math Object

JavaScript Math Object In this JavaScript tutorial you will learn about Math Object usage properties and methods of math object along with syntax and examples mosgoogle center Usage of Math Object JavaScript Math object is used to perform mathematical tasks But unlike the String and the Date object
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape