• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Interview question regarding sendRedirect() and Forward()

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I was asked in an interview like "say we have two war files output of one servlet in one war file generates JSp in tht war and its that will have input to other servlet in another war file and it generates a JSP with output,user is bothered only output of second war file where as request starts from first war file,here which one we have to use wheter Sendredirect() or forward() with requestDispatcher" ..

Please explain eloborately.Thanks in Advance....
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not getting your question.

just I am guessing you need to talk to another web application? then you *cant* use forward which is used on server side(particular).
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here the interviewer testing your basic skills on servlets.

Send Redirect

Forward

Forward vs SendRedirect.
 
Author
Posts: 3473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is explanation on forwarding Vs Redirecting
 
praneeth gajji
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply,I am explaining question clearly please provide me solution.


"In An application server there are 2 war files output of one war file is input to other war file.user is concerned about final output that is coming.Request is made for first war file where as final response i from 2nd war file."

In the above situation which one we use(sendRedirect or forward) and why.Explain me, I am in little bit confusion..
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if both wars are in same server then, you can use forward on context(only some server support it.) . otherwise use redirect with query string.

 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic