• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RequestDispatcher

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we include from / forward to a recsource in difference context but in the same web server using include() / forward()
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use the search function at the top right of this page and search for the word "RequestDispatcher". There are some good threads regarding this very subject...
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes.
ServetContext otherCtx = getServletContext().getContext("anotherContext");
RequestDispatcher rd = otherCtx.getRequestDispatcher("jspor servlet");
rd.forward() ;

Originally posted by Sam Cala:
Can we include from / forward to a recsource in difference context but in the same web server using include() / forward()

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by pradeep bhat:
yes.
ServetContext otherCtx = getServletContext().getContext("anotherContext");
RequestDispatcher rd = otherCtx.getRequestDispatcher("jspor servlet");
rd.forward() ;


ServletContext.getContext("anotherContext") may return null for security reasons depending on the appserver. So, this may not work in all cases.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic