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

Great!  Thanks so much, I already have filters so that should be easy.


From:        Simone Bordet <sbordet@xxxxxxxxxxx>
To:        JETTY user mailing list <jetty-users@xxxxxxxxxxx>,
Date:        02/19/2013 04:47 AM
Subject:        Re: [jetty-users] X-FRAME Header option
Sent by:        jetty-users-bounces@xxxxxxxxxxx


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
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.
jetty-users mailing list

Back to the top