Differences between (response.sendRedirect and Requestdispatcher.forward)

Hi All,
I have 3 queries
*1> I wanted to know the "Differences" between*
response.sendRedirect and Requestdispatcher.forward
*2> when do we Opt for response.sendRedirect?*
*3> when do we Opt for Requestdispatcher.forward?*
Thanks,
Deepak AL

The fundamental difference is that sendRedirect is a client based direction, while forward is a server based one.
SendRedirect forces the client to make a new request. In effect you are telling the client browser "What you are looking for is over there"
RequestDispatcher forward, is purely an internal server transition. The client knows nothing about the forward happening.
Example
Lets say you request the page www.myserver.com/myPage.jsp
Example A: Redirect
We send a redirect to www.myserver.com/thatPageOverThere.jsp
The browser receives this message, and its address url changes to www.myserver.com/thatPageOverThere.jsp, and it sends a new request over there.
Note that it is a completely new request, so any parameters that were sent with the old request are irrelevant. If you want to send them again you have to put them into the sendRedirect url.
You can also send a redirect to www.myOtherServer.com/thatPageOnACompletelyDifferentServer.jsp
Example B: Forward to thatPageOverThere.jsp
We obtain a request dispatcher to "thatPageOverThere.jsp" and forward to that resource.
The server instead of running myPage.jsp now executes and returns thatPageOverThere.jsp
The client browser knows nothing of this. As far as it knows it asked for myPage.jsp, and it is getting that response back.
So if you forward to something like "my/page/inASubFolder.jsp" you have to be very careful with relative links on the page.
The browser requested myPage.jsp, so it will resolve relative links from that Url.
When to use one or the other?
Redirect would need to be used when the resource is on another server.
Another common usage is the "Post-Redirect-Get" pattern. (you might want to look that up)
Hope this helps you understand a little.
cheers,
evnafets

Similar Messages

  • Difference between GENERAK TASK and GENERAL FORWARDING ALLOWED??

    Hi,
    Can anybody explain whats the actuall difference between GENERAL TASK and GENERAL FORWARDING ALLOWED.
    Both option allows to forward the workitem to any user. So what makes them difference?
    Thanks

    Hi,
    look here :
    [http://help.sap.com/saphelp_dimp50/helpdata/En/c5/e4b535453d11d189430000e829fbbd/content.htm]
    regards

  • Difference between response.flushBuffer() and flush="true" in include file

    I am using JSP with Tomcat and surprised with the behaviour.
    In first case, if we use response.flushBuffer() and after that neither forward works nor the sendRedirect() works.
    In the second case, I have included a jsp file in another file with using the <jsp:include .... flush="true"/>
    Now the forward doesn't work after this line while the sendRedirect works fine.
    In both cases I got the error response has already been committed ...
    I would like to know whether response.flushBuffer() in first case and flush = "true" in second case does the same work or do something different.
    If its different then what is it ????
    If same then either redirect must work for first case or redirect should not work for second case.
    Thanks
    Satya

    In the first case (response.flushBuffer()) you flushed the response buffer which commits the response back to the client. You can not do a sendRedirect or requestDispactcher forward after the response has been committed. In otherwords you have commited the response from one servlet you can not change and have it come from another.
    In the second case (<jsp:include .... flush="true"/>) you flushed the buffer but you are adding the response from the included JSP into the calling JSP response so the response is still coming from the same source.

  • Differences between Online Number and Call Forward...

    I have an unlimited subscription for the United States. For others to call me though I am not sure what the best option is. Could someone please clarify the differeces between having an Online number and having calls forwarded?

    pebaker2 wrote:
    Could someone please clarify the differeces between having an Online number and having calls forwarded?
    Hello,
    An Online # is for your contacts to call you. (You can't make calls from it).
    Call forwarding is simply forwarding a received call to another phone of your choice.
    To receive calls from your contacts you will need an Online #.
    http://www.skype.com/intl/en-us/features/allfeatures/online-number/
    http://www.skype.com/intl/en-us/features/allfeatures/call-forwarding/
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • Difference between sendRedirect and RequestDispatcher?

    Difference between sendRedirect and RequestDispatcher?

    I have a situation of needing to redirect a request to a URL that is outside of the container. The scenario is the following, we have a simple logging in servlet that takes some POST parameters (username, password, and other values.) Depending on the username and password, the logon request along with all its POST parameters need to be redirected integrally to another machine. How do i do a redirect with all my parameters intact? sendRedirect does not seem to have any (visible to me) mechanism to do this. We cannot send them on the URL as this will reveal things too easily to our users and we don't want them to bookmark the resulting page.
    Thanks for any help,
    t

  • What is the difference between PO confirmation and PO response?

    Dear experts
    What is the difference between PO confirmation and PO response?
    I see that:
    BUS2203 Confirmation
      BUS2209  PO Response
    And the PO response will change the PO.
    While what is the difference ?
    Thanks & Regards,
    Hayashi

    Robin
    Thank you very much for your response. It is very clear.
    Could you help on explaining further on the difference between:
    BUS2205 Incoming Invoice
    BUS2210 Invoice Default
    BUS2232 SUS PO Confirmation 
    BUS2233 SUS Confirmation
    Thanks.
    Regards,
    Hayashi.

  • What is difference between bex analyser and bex browser

    what is difference between bex analyser and bex browser . please explain what are use of both and what we do in both.

    hi
    Bex Browser
    The Business Explorer Browser (BEx Browser) makes it possible for you to access all document types of the Business Information Warehouse that are assigned to your role or that you have stored in your favorites. You can select and open documents assigned to you in the BEx Browser or store and manage new documents in the BEx Browser.
    Document types that you can work with in the BEx Browser are:
    · BW workbooks
    · Documents that are stored in the Business Document Service (BDS)
    · Links (references to file system, shortcuts)
    · Links to internet sites (URLs)
    · SAP transaction calls.
    · Web applications and Web templates
    · Crystal Reports
    Bex Analyser
    The Business Explorer Analyzer (BEx Analyzer) is the analysis and reporting tool of the Business Explorer that is embedded in Microsoft Excel.
    Features
    You can call up the BEx Query Designer in the BEx Analyzer, in order to define queries. Subsequently, you can analyze the selected InfoProvider data by navigation to the query created in the Query Designer and create different query views of the data. You can add the different query views for a query or for different queries to a work book and save them there. You can save the workbook in your favorites or in your role on the BW Server. You can also save the workbook locally on your computer.
    Beyond that, you can precalculate the workbook and distribute it by e-mail to recipeients or you can export it to the Enterprise Portal and make it accessible to other employees in the company.
    You can start queries in a standard view (with a Standard Web Template set up in Customizing) in the Web browser and forward the URL or continue to navigate on the Web. Similarly, you can export the Web query to MS Excel 2000.
    Overview of the Functional Area of the BEx Analyzer:
    ·        BEx toolbar
    You access the functions of the BEx Analyzer from the BEx toolbar, which takes you to the BEx Open dialog box where you can open existing queries, or to the BEx Query Designer where you can create new queries or change existing queries.
    ·        Evaluating Query Data
    The BEx Analyzer offers convenient functions for evaluating and presenting InfoProvider data interactively. In the BEx Analyzer, you can add queries to workbooks, navigate within them and refresh the data. You can also process the queries further in Microsoft Excel or display them in the Web browser in a default view.
    Navigation of a query allows you, for example, to filter characteristics on a single value, drilldown on all values for a characteristic, regroup characteristics and key figures in the rows and columns of the results area, or hide key figures. Navigation results in different views of the InfoProvider data. In addition, a range of further functions is available which allow you to edit a query interactively (for example, sorting, cumulated output, among others). In addition, you can use the editing functions in Microsoft Excel in order to set up individual format templates, to print results areas, or to create graphics.
    ·        Queries in Workbooks
    Queries are inserted into workbooks so you can display them. When you insert a query, a link is made between the cell areas of the worksheet and the data of the InfoProvider upon which the query is based. A link therefore exists between the Business Explorer and the Business Information Warehouse Server (BW Server).
    When inserting a query into the workbook, a VBA routine is automatically generated in the workbook. You can also connect the Business Explorer with your own VBA programs (Visual Basic for Applications).
    You can create workbook templates, into which you can insert your queries. Workbook templates can contain pre-determined items for the area of the query, formatting settings, logos, VBA macros, and so on.
    ·        Precalculating workbooks
    You can precalculate and distribute workbooks with the BEx Broadcaster, which is a Web application you get to form the BEx toolbar. The system generates MS Excel workbooks with historical data. You determine the time for precalculation yourself: You can have workbooks precalculated at a predefined time or they can be precalculated whenever data in the underlying InfoProvider changes. You can have the precalculated workbooks sent by e-mail or you can export them into the Enterprise Portal, where you can make them available to employees within your company.
    Activities
    To start the BEx Analyzer, choose Start ® Programs ® SAP Front-end Business Information Warehouse ® SAP Business Explorer Analyzer.
    You can also access the BEx Analyzer via SAP Easy Access ® SAP Business Information Warehouse ® SAP Menu ® Business Explorer ® Analyzer or in the Business Explorer Browser using the Business Explorer Analyzer symbol in the menu bar.
    Hope this will solve your issu
    nagarjuna

  • Difference between open loop and closed loop mode when finding the index on a stepper motor axis.

    I have a test system which uses a PXI-7352 motion controller with a MID-7602 stepper motor drive to position a 200 step/revolution stepper motor with an attached 1000 line encoder.  The MID-7602 is configured for 64 microsteps per step, giving 12,800 microsteps and 4000 encoder counts per revolution.  The system is controlled using LabView 7.1 and NI-Motion 6.13.  To home the motor, I've defined a sequence in MAX which first finds the reverse limit switch and then moves forward to the encoder index pulse.
    When finding its reference in open loop mode, the system its reference at the same microstep each time.  When findings its reference in closed loop mode, the system finds its reference somewhere within about a 20 microstep wide range.
    I hope somebody out there with more experience with this controller can describe the difference between finding the encoder index in open loop mode and finding the encoder index in closed loop mode. 
    Thanks,
    Mark Moss

    Hello Mark,
    I suspect that the behavior you are experiencing has today
    with the resolution difference between your encoder and your
    microstepping.  Let me illustrate with an
    example:
    Example Setup
    Stepper
    Motor
    NI
    Motion Controller
    10
    steps per encoder pulse (Every 10 steps the controller gets an encoder
    pulse, therefore positions 0-9 all appear to be 0 to the controller)
    The
    system has a maximum of 3 pull in moves set
    Open Loop Scenario
    The
    system is commanded to go to position 9.
    The
    controller sends out 9 pulses.
    The
    motor moves to position 9.
    Closed Loop Scenario
    The
    system is commanded to go to position 9.
    The
    controller sends out 9 pulses.
    The
    motor moves to position 9.
    The
    controller checks its position and sees that it is still at position 0
    because it has not received an encoder pulse.
    Because
    the controller thinks it is still at position 0, it sends another 9 pulses
    as its first pull in move.
    The
    motor moves to position 18.
    The
    controller checks its position and sees that it is at position 10 because
    it has only received one encoder pulse.
    Because
    the controller thinks it is still at position 10, it sends1 reverse pulse
    as its second pull in move.
    The
    motor moves to position 17.
    The
    controller checks its position and sees that it is at position 10 because
    it has only received one encoder pulse.
    Because
    the controller thinks it is still at position 10, it sends and additional
    single reverse pulse as its third pull in move.
    The
    motor moves to its final position of 16.
    I believe something similar is happening with your
    application as it looks for the index pulse. 
    Because the controller does not compensate for what it perceives as
    position error in open loop mode, the motor always goes to the same commanded
    position.  In closed loop mode, the motor
    is bouncing around inside the single index encoder pulse trying to find a
    certain position.
    There are several recommendations I can make towards
    correcting this behavior.  These
    recommendations are in order of effectiveness:
    Setup
    your system so that there are more encoder counts per revolution than
    steps per revolution.
    Turn
    off pull-in moves by setting them to 0 in MAX.
    Use an
    open loop configuration.
    Play
    around with the pull in window in MAX.
    Regards,
    Luke H

  • Difference between conn.close() and conn=null;

    Hi All,
    Can anybody please let me know the difference between conn.close()
    and conn=null;
    where conn is reference to Connection.
    Thanks and Regards
    -sunjavadeveloper

    Thanks for your response.
    Is there any other good approach to close() & then
    null the Obj. can u give us your opinion.
              finally
                try{
                         if(dbconn != null)     dbconn.close();
                         if(stmt != null) stmt.close();
                         if(rs != null) rs.close();
                         if(con != null) con.close();
                catch (Exception e)
                       logger.fatal(e.getMessage(),e);
    throw new Exception ("Exception -- Vendor.java --
    a -- authenticate -- " + e.getMessage() );
                   dbconn = null;
                   rs = null;
                   stmt=null;
                   con = null;
    Putting the close() calls in finally block is good, but having them in individual try/catch blocks is better. That way you can still try to close the connection if closing the statement throws an exception.
    I don't bother setting them to null. GC is smart enough to know that they've gone out of scope. I don't think it helps.
    %

  • Difference Between Current Day and fist day of the payroll period

    Hi,
    How do i find the difference between the current day and the first day of the payroll period with period parameter XX.
    Operation VARSTFDYXX is used to decide if the current day is the first day of the payroll period. But is there any operation available to check the difference in exact number of days.
    I know hrs=y is used to find difference between current day and a date specification record from IT0041, but i need to check difference between current day and first day from a payroll period parameter.
    Any response is greatly appreciated.
    Thanks,
    Imaneul Rajiv

    No! haven't seen it at all! Do I have to drain the battery completely and then charge it? I did that the first day I bought the phone and yet the stats are the same for me
    PS: I am referring to the Call Time stats and not the Usage/Standby stats

  • Difference between 'materialized vews' and snapshots

    Hello,
    i have two questions:
    what the difference between 'materialized vews' and snapshots? In fact, in create thoses Oracle Objects:
         create materialized view log on T1
         Create materialized view T1_MV
              Build immediate
              Refresh fast on commit
              As Select COL1,COL2 from T1
         Create snapshot T1_SNAPSHOT
         Build immediate
         Refresh fast on commit
         As Select COL1,COL2 from T1
    and in find that T1_MV and T1_SNAPSHOT have the same caracteristics in dba_tables and DBA_SNAPSHOTS and DBA_MVIEWS.
    seconde question: what's the difference between DBA_SNAPSHOTS
    and DBA_MVIEWS tables?
    I work under oracle 9i
    thinks for response.

    Backwards compatibility. Some apps might reference DBA_SNAPHOTS and it would be a PITA to change them. Eventually Oracle might decide that it's a greater PITA for them to keep those views and ditch 'em.
    Cheers, APC

  • Difference between Scheduling lines and Delivery schedule

    Hi SD Experts
    can u say me the clear difference between Scheduling lines and Delivery schedule.
    where we will maintain deliver schedule. whether delivery schedule is automatically created along scheduling agreements..
    with regards
    James

    Hi James,
    Schedule Lines: Has basically information realted to delivery scheduling in Sales Order level.
    Delivery Scheduling: Is a process using which system will determine what are the different activities which need to be performed and time taken for each activitiy only after which the material can be delivered to the customer.
    Delievry scheduling will be started only from the material availability date i.e., system will first determine the material avail date and then do scheduling. By default Standard SAP system does Backward Scheduling in case material availability falls beyond the required delivery date system will do forward schedluing
    Delivery Scheduling consists of the following Basic activities:
    We give deatils while creating order:
    Order Creation Date
    Required Delivery Date
    Order date - Material availability date - Transportation Planning Date - Loading date - Goods Issue Date - Required Delivery Date
    Time Between GI Date and required Delivery Date is called Transit Time
    Time Between LoadingDate and GI Date is called Loading time
    Time Between Material Availability Date and Loading Date consists of 2 components - Pick / PackTime and Transportation Planning Time
    System has to calculate all this before it determines the confirmed delivery date.
    Give your mail Id I have some Presentation I will send you across.
    REWARD POINTS IF IT HELPS
    Regards
    Srini

  • What is the difference between local printing and remote printing in SAP

    Hello Nation,
    I would like to know what is the difference between local printing and remote printing in SAP and in what scenarios they are used ?
    1.What is local printing in SAP ?
    2.What is Remote Printing in SAP?
    3.what is the difference between local printing and remote printing in SAP ?
    Thank you in Advance.
    Regards,
    -Mohamed Naveen.

    Hi,
    This is SAP Business one system administration forum. Please find correct forum and repost your discussion to get quick response.
    Please close this thread here with helpful answer.
    Thanks & Regards,
    Nagarajan

  • Difference between Business Process and Workflow

    Hi all,
    What is the difference between Business Process and Workflow? i have googled it and I don't really understand that complicated definition? Is there any examples to illustrate the difference between the both?

    Hi,
    I will try to put here , my perspective of this. If somebody knows better, they can update further on this.
    Business process is purely on the perspective of the users. It may or maynot have anything to do with the system. When a draw a business flow diagram, we dont take care of how each and every process is handled in the system. The best illustration is an example of authorisation.
    Let me say that I create a Purchase requisition. Once it is released a PO will be created by procurement managerD
    This is a business process. However if we look at the system perspective, it can be like this.
    1. Create a PR.
    2. Check the value of the PR
    3. If value <$100,an email needs to be send to person A, if it is $100 to 300$, an email should be send to person B and if >$300, an email should be send to B and C.
    4.Once it is released, an email shoudl be send to D for creating a PO on this PR.
    Here not only the process, but also how the work is delegated across  various entities of the process is mentioned.
    There are softwards like VISIO which actually take care of the business process in the perspective of the entities involved in the process. A workflow is a moredetailed version of business process with the roles of entities clearly defined and hence configured well in the system.
    The concept is workflow is mostly used in the processes of authorisations, business activity monitoring(BAM), etc.
    Hope I make it little clear to you.
    You can reward if my response is of some help to you

  • Difference between Business area and profit center accounting

    Hi Frnds,
    Can any body explain about difference between business area and profit center accounting .

    Hi
    Business area will have many profit centers. For example Vehicle is a business area in a company. Vehicle can be cars and Bikes etc. Here Vehicle is business area and Cars and Bike are profit centers. In broad Vehicle is a profit center. But as it has sub areas those are profit centers. So profit centers cannot be replaced with business area and vice versa. We can replace business area by Profit centre, only condition is that it should be in same controlling area. The business area is more like a business unit of a company. You can have multiple profit centers within a business area.
    Main distinguish factor is that distribution and assessment in possible in profit center but not in business area.
    One more distinction is that Business area need not be attached to any organisation structure. But profit centres can be created only under the controlling area. Business area can be across controlling area.
    Business area concept is used for making stragic decisions by the management whereas the primary purpose of profit centre accounting is responsibility accounting.
    http://help.sap.com/saphelp_erp2005/helpdata/en/ff/277203deea11d3b5b4006094b9b0a5/frameset.htm

Maybe you are looking for