Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get HttpServletResponse in a Java class?

Sahar HassanMar 27 2012 — edited Mar 27 2012
I have the following code:

HttpServletResponse response = (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();

This is usually used when there is a page with a method in the backing bean.

What I have is a Java class, with no page. I want to alter the code above with something else in the right hand side.

JDev version: 11.1.1.5.0
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 24 2012
Added on Mar 27 2012
4 comments
773 views