File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Cross frame Scripting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Cross frame Scripting" Watch "Cross frame Scripting" New topic
Author

Cross frame Scripting

lakshmi gullapudi
Greenhorn

Joined: Mar 18, 2013
Posts: 16
How to add X-frame options header in .htm file

its working fine when i add <% response.addHeader("X-Frame-Options", "SAMEORIGIN"); %> in JSP page.

But not sure how to add X-frame options in .htm file?

Can any one please help me?

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30516
    
150

You can turn it into a JSP . You can also have your web server (for example Apache) set the headers - I've never needed to do that though.

You can't add this header directly to a HTML file.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Rob Crowther
author
Ranch Hand

Joined: Nov 06, 2012
Posts: 295
    
    5

You would have to configure your web server to send the header, either with all requests or just for requests matching a particular pattern. MDN has some instructions for Apache and nginx.


Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Cross frame Scripting