Somebody wrote a messages on tomcat Console - tomcat7

I've an application deployed on Tomcat 7, and this morning I noticed two messages on Tomcat console:
Did you see me on the stderr window?
Did you see me on the browser window as well?
Somebody managed to write remotely these messages. Do I have to be worried ? did somebody hack my website ?
thanks,
Frank

This is produced by a example jsp (webapps/examples/jsp/foo.jsp) with the following lines:
<eg:log>
Did you see me on the stderr window?
</eg:log>

It looks that is a standard Tomcat output message.

When you're running tomcat and go in the localhost:8080/manager/html, there's a site called /examples containing the following
Apache Tomcat Examples
Servlets examples
JSP Examples
WebSocket Examples
In the JSP Examples, if you go in the Custom tag example, a page will pop up with the following rendered in the browser:
Radio stations that rock:
98.5
92.3
107.7 Did you see me on the browser window as well?
The source code for this shows it's writing a log with a taglib prefix "eg" in the console:
<html>
<body>
<%# taglib uri="http://tomcat.apache.org/example-taglib" prefix="eg"%>
Radio stations that rock:
<ul>
<eg:foo att1="98.5" att2="92.3" att3="107.7">
<li><%= member %></li>
</eg:foo>
</ul>
<eg:log>
Did you see me on the stderr window?
</eg:log>
<eg:log toBrowser="true">
Did you see me on the browser window as well?
</eg:log>
</body>
</html>

Related

IIS 8.5 Windows 2012 R2 64 bit executing partial asp/vbscript statements

Hi I have a asp page which has following statements
<html>
<body>
<%
response.write("My ASP Page")
%>
<%
Application("name")="Test Page"
response.write("</br>")
response.write("Your App Name is " & Application("name"))
response.write("</br>")
%>
</body>
</html>
when I try to run this page under IIS 8.5 it is showing below
My ASP Page
Error '8002801c'
/test.asp line 7
I am using a 32-bit enabled .Net 2.0 Classic application pool.
I am struggling to get rid of this error. Any help on this would be highly appreciated.
I was able to resolve this by setting my application pool 32-bit flag to false.

Selenium Ruby Webdriver - how to close IE9 browser session with popup displayed

I'm doing some modifications on a page in my web application, this results in a popup message displayed "This page is asking you to confirm that you want to leave - data you have entered may not be saved" with two buttons "Leave Page" and "Stay on Page".
I can close my web application if using FF16 or Chrome with below code:
#driver.quit
However, I cannot close if I'm opening my web application on the browser IE9 (it means that I can open another IE9 browser session, but the browser session with popup message displayed is NOT closed).
I'm using Selenium Ruby Webdriver. Please help guide me a solution to resolve this problem. Thanks much.
I found out the expected answer for my question at: https://stackoverflow.com/a/7034926/1385187 (Thanks so much for this great answer).
( ( JavascriptExecutor ) _driver )
.executeScript( "window.onbeforeunload = function(e){};" );

Telerik RadDatePicker error related to DbSelectedDate

I'm using Telerik in one project and I have some troubles with it.
Specifically, I want to use a RadDatePicker, and I defined it as below:
<%# Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadDatePicker ID="txtEndDate" runat="server" Width="140px" Skin="Windows7"
DateInput-EmptyMessage="End Date" MinDate="01/01/2000" MaxDate="01/01/2050">
<Calendar>
<SpecialDays>
<telerik:RadCalendarDay Repeatable="Today" ItemStyle-CssClass="rcToday">
</telerik:RadCalendarDay>
</SpecialDays>
</Calendar>
</telerik:RadDatePicker>
And in code behind I use:
txtStartDate.DbSelectedDate = Date.Today.AddDays(-7).ToString("MM/dd/yyyy")
But when I build I get the following error
Error 62 ...: error BC30456: 'DbSelectedDate' is not a member of 'System.Web.UI.WebControls.TextBox'.
Any idea what can be?
In another page I have the RadDatePicker defined the same way and it works there
Thanks
Actually, this error seems to be a side effect.
It occured in one application which was converted from Website-type project to webapp type project. After initial importing files, there were about 2000 errors (most caused by missing / wrong references or namespaces).
I ignored that error and fixed other, and the suddenly the error dissapeared.

How do you suppress script errors in HTAs?

I have an HTA that loads up an external webpage inside a nested IFRAME. This webpage (which I don't have control over) throws an "Access Denied" error in my HTA asking the user if they "want to continue running scripts on this page". What I want to do is have my HTA suppress all scripting error messages regardless of where they originate
Here's a very basic idea of how my setup is working:
<html>
<head><HTA:APPLICATION ... ... </head>
<body>
...
<div id="navigation">...</div>
<div id="browsers">
<iframe APPLICATION="yes" src="http://myserver/browse.php?src=http://www.example.com/">
<!-- contents of http://myserver/browse.php?src=http://www.example.com/ -->
<html>...
<body>
<div id="titlebar">...</div>
<iframe APPLICATION="no" src="http://www.example.com/">
<!-- contents of http://www.example.com/ with js that causes error -->
</iframe>
</body>
</html>
</iframe>
<iframe APPICATION="yes" src="http://myserver/browse.php?src=somethingelese"></iframe>
</div>
</body>
</html>
And here is a screenshot of the error:
As far as I know there isn't a way to suppress errors like that. If you have access to their registry or group policy here is the relevant Registry Value (for IE naturally) that disables that popup:
Key: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
Name: Disable Script Debugger
Type: REG_SZ
Value: no
A sentinent GetWindowText() -> SendMessage WM_CLOSE based dialog closer could deal with that but is not exactly disabling
I've been searching for days and haven't found solid solution - perhaps HTAs do not serve their simplistic rationale after all, at least when using actual browser info
By the way changing the IE8 script debugger does not disable the error message - it merely disables the debug dialog and replaces it with a script error
Unchecking the IE flag "Error Dlg Displayed On Every Error" does not alleviate the issue either

Problems with registering click event listener to a frame-element

I ran into a problem with adding an event listener. I wrote a Firefox plugin a while ago for my bachelor thesis. It was based on a different attacker model than you would normally expect. In this scenario the attacker was the service provider (like Facebook, Google,...), who reads all your private data stored on their site (via JS).
My final solution was to temporally allow JS (while the page loads and after an user action occured). To observe the interaction I used event listener, which worked very well so far. But last week I noticed that my approach doesn't work with web sites which are using a frameset (I added the event listener to the body...).
So I tried to add the listener to the frameset respectively to the frame. But the clicks are only noticed when you actually click on the frame... (eg resize the frame with your mouse) But I want to register clicks on the document loaded inside the frame.
I already tried the .frameElement. Sadly it seems that Firefox doesn't like my (or, which is more likely, I'm too stuipd :) ) and claims there are no frames...
Could anyone tell me how to add an event listener to the document inside a frame? The web site looks like this:
<html>
<head>
<title>Frameset Test</title>
</head>
<frameset cols="150,*">
<frame src="nav.html" name="Navigation">
<frame src="main.html" name="Main">
</frameset>
</html>
This was my first bigger projekt with Mozilla so this could be a really dumb failure of mine... I hope you guys can help me. Thanks in advance.
Sebastian
If you have a reference to the parent window you could try this:
var frames = window.frames;
for (var i = 0; i < frames.length; i++) {
// frames[i] is the window object inside the frame i
}
More info here: https://developer.mozilla.org/en/DOM/window.frames

Resources