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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JSP forward help

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Report post to moderator
After forwarding control to another JSP page or servlet using the RequestDispatcher.forward() method, can the response be modified once the forward method returns? For example,

<%
RequestDispatcher rd = request.getRequestDispatcher("/somepath");
rd.forward(request, response);

response.getWriter().println("Some more output");
%>
[ August 16, 2004: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 120
IntelliJ IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Not sure. Regarding this. But in any case you can use filter. Filter is a class that get access on the each ouput response before it should be sent to the client. So whenever request is fullfilied it comes to the filter and it can add or remove some attributes. If some redirection was performed during the request fullfillment it does not make any effect on the filter logic.
http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html
 
Marshal
Posts: 67447
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
"Mr Singh",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Bear Bibeault
Marshal
Posts: 67447
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
With regards to your question, what happened when you tried it?
 
Bear Bibeault
Marshal
Posts: 67447
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
also, please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please continue any discussion of this topic here.
 
    Bookmark Topic Watch Topic
  • New Topic