Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] X-FRAME Header option

Hi,

On Tue, Feb 19, 2013 at 4:54 AM, Ike Ikonne <iikonne@xxxxxxxxxx> wrote:
> Hi all,
>
> We embed Jetty with our application, I would like to know how I could tell
> the Jetty server to include the X-FRAME option in all responses to the
> client. Would this piece of code do the trick?
>
> import org.eclipse.jetty.server.Server
>
> Server server = new Server();
> server.setAttribute("X-Frame-Options", "SAMEORIGIN");

Setting an attribute in the server will not affect the responses.
Instead, write a Servlet Filter that sets header you want in the responses.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top