Setting X-Frame-Options header without changing java - jetty

I have a black box application that runs on old obsolete Jetty 7. However, it has been working well since we installed it in 2014, and I need it to continue running. I have been asked to add an X-Frame-Options header to the interface, and every time I try to do this by changing Java I get class incompatibility errors. I can, however, make any changes I like to the JSP files, to web.xml, or to the Jetty configuration files in jetty/etc, but so far I have not found a change that works. I tried adding
<* response.addHeader(“X-FRAME-OPTIONS”, “DENY”); *>
to various JSP files but it doesn't seem to help. Does anyone have any ideas?

Related

Inclusion of certain libraries causes service not to start C++ (fastcgi)

I am writing a simple service in c++. I have copied the example on
http://www.codeproject.com/Articles/499465/Simple-Windows-Service-in-Cplusplus
verbatim, and everything works fine. Now I needed to add my code for the working thread. I add all of my files to the project, and at this point I still have the exact code from the link, so my project isn't really even using the other cpp/h files I just added. I try to start the service, and boom "cannot start in a timely fashion".
I have tried commenting out of the method definitions of the cpp files I have added, and I've figured out that any method that uses a function from the fastcgi libraries
(found here : http://www.fastcgi.com/drupal/)
causes the service not to start. If I comment out every method uses the fastcgi library, the service will start (but I kind of need those).
Is there any way I can figure out why the use of these libraries are causing the windows service I'm making not to start? (everything works fine as a console application)
Thanks

Seamless (RSE) Remote Projects in Eclipse

I've been trying - without much success - to make Eclipse (for C/C++, but that should be irrelevant) play nicely with remote projects. It would make my life at work much easier if I can set things in the following way:
Run Eclipse from my local Windows machine
Connect (through Eclipse) to the remote Linux development box
Create an Eclipse project from files and directories already created on the remote box
Configure project dependencies and symbols using files and directories from the remote box
Building and running the project in Eclipse is not needed - since this is done with a million makefiles, it's easier for me to just SSH into the box and build from command line. I just need Eclipse to recognize included resources
I tried setting this up with Remote System Explorer (RSE), but couldn't quite get it to work. I can create a connection to the remote box, browse its files, and even convert certain directories to Remote Projects. Once the remote project is created, however, it's useless to me - Eclipse underlines everything that's not a C/C++ keyword, saying it doesn't recognize it (even #include statements of system libraries); equally important, it doesn't allow me to add remote resources to the Paths & Symbols of the project.
Am I missing something here, or RSE just not capable of doing what I need it to?
No, I don't think you're missing something here. I already faced a similar problem when creating/editing remote projects. As far as I can judge, this must be due to the C/C++ indexer not working correctly for remote projects. One action to make Eclipse recognize the #includes is to close and reopen the project through the Project Explorer View. If this doesn't help, try highlighting the #include statement and press F3. Opening the included file seems to trigger the indexer to update the index (although this should also be possible by right-clicking the project and selecting the Rebuild Index function; but this didn't work me). But even after performing these steps, indexing isn't fully functional, e.g., the Call Hierarchy is not working at all (it tells me "File XY is currently not part of the index").
Btw, which protocol do you use for your connection (ssh, ftp, or dstore)? I read some posts that RSE only works seamlessly if the dstore protocol is used. Unfortunately, this wasn't the case for me...

Can I disable precompilation for a particular folder?

I have some .cshtml templates I'm using to render to PDFs.
When I deploy to production they get precompiled and contain the text "This is a marker file generated by the precompilation tool, and should not be deleted!" Is there a way to tell ASP.NET not to precompile a particular subfolder? I thought maybe I could do this in web.config, but I can't find it.
I know this is 2 years old but recently I stumbled on the same problem, but since I needed the view for both MVC and e-mail I couldn't simply change the extension of the file.
Searching for solutions I found this documentation on aspnet_compiler and the -u options, that stands for Updatable, which keeps the original file intact after compilation.
In order to achieve the desired behavior I configured my publish profile as follow:
On Settings tab of Publish dialog expand the File Publish Options and check Precompile during publishing.
Click the Configure link after the checkbox and check Allow precompiled site to be updatable
Caution
Before jumping in this solution you should read carefully about the implications of this option. In the link I provided there is a Precompilation Decision Matrix to help on your decision.
I couldn't stop the views from being compiled, even by setting the build action to 'none' and turning on copy to output directory.
I ended up changing the extensions of my files to .prod, setting the content type as 'content', and setting them to open with the HTML editor in Visual Studio to get everything working the way I wanted.

how to upload and compile cpp for cgi-bin on WHM/cPanel?

I am brand new to C++. I am creating AJAX files in the cgi-bin for maximum speed vs PHP.
My host is no help, I can find no docs on this, and searches return nothing (probably because of my limited vocabulary on the subject).
I want to upload cpp files to my WHM/cPanel VPS to compile for the cgi-bin. I have no idea what directory to put these for compiling or how exactly to do it.
How do I upload cpp files to a WHM/cPanel VPS, compile them, and move them to the cgi-bin?
Many thanks in advance!
You should put your compiled binaries (your C++ code must implement the CGI interface) in whichever folder your web server treats as active (i.e. CGI). If there is a folder where PHP files are run using the CGI interface, then putting the C++ binaries in the same folder should work (unless the server is set up with special filters to block running binaries for security purposes).
And yes. This isn't a very common problem. Though when I did it, it was very straight forward (I just dropped the binaries in and off it went).

Django Static compressed files not rendering on Firefox

I am using django-static for optimization of static stylesheets and javascripts. Now all these scripts and css properties are being loaded in Chrome and on Safari. But for some reason they are not loading in Firefox. Am i doing something wrong? Does Firefox require some other setting ?
If additional information is required please comment. I will add it. (Firefox version 8)
EDIT:
After checking Chrome and Firefox using Firebug. I found that the script being rendered was with the source as
src="/media/js/hawk\foo_boo_ajax_too_forms_refer_moder.1323864494.js
Now this is being interpreted by Chrome as
src="/media/js/hawk/foo_boo_ajax_too_forms_refer_moder.1323864494.js
But firefox is not able to interpret it. Is this a firefox issue or do i have to change the "/"? (The link or source being generated is by django-static. )
Per the URI spec, you need to change to '/'.
make sure you have the correct Content-Type and Content-Encoding headers set for your js and css files.
The above said issue ,is a bug in django-static. This issue crops up on windows machine.(On windows it mixes up file system path and the url.)I have contacted the developer, and I think the issue will be solved soon. Hope this helps others.