You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2007/06/10 00:38:18 UTC
svn commit: r545805 - in /struts/struts2/trunk/core/src/main:
java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java
resources/org/apache/struts2/interceptor/debugging/webconsole.js
Author: musachy
Date: Sat Jun 9 15:38:17 2007
New Revision: 545805
URL: http://svn.apache.org/viewvc?view=rev&rev=545805
Log:
Minor changes in order to be able to embed the console on a regular page (for interactive demo)
Modified:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java
struts/struts2/trunk/core/src/main/resources/org/apache/struts2/interceptor/debugging/webconsole.js
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java?view=diff&rev=545805&r1=545804&r2=545805
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java Sat Jun 9 15:38:17 2007
@@ -184,6 +184,11 @@
});
} else if (COMMAND_MODE.equals(type)) {
ValueStack stack = (ValueStack) ctx.getSession().get(SESSION_KEY);
+ if (stack == null) {
+ //allows it to be embedded on another page
+ stack = (ValueStack) ctx.get(ActionContext.VALUE_STACK);
+ ctx.getSession().put(SESSION_KEY, stack);
+ }
String cmd = getParameter(EXPRESSION_PARAM);
ServletActionContext.getRequest().setAttribute("decorator", "none");
Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/interceptor/debugging/webconsole.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/interceptor/debugging/webconsole.js?view=diff&rev=545805&r1=545804&r2=545805
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/interceptor/debugging/webconsole.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/interceptor/debugging/webconsole.js Sat Jun 9 15:38:17 2007
@@ -21,7 +21,7 @@
document.getElementById('wc-command').value = '';
}
- function keyEvent(event)
+ function keyEvent(event, url)
{
switch(event.keyCode){
case 13:
@@ -29,7 +29,7 @@
if (the_shell_command) {
commands_history[commands_history.length] = the_shell_command;
history_pointer = commands_history.length;
- var the_url = window.opener.location.pathname + '?debug=command&expression='+escape(the_shell_command);
+ var the_url = (url ? url : window.opener.location.pathname) + '?debug=command&expression='+escape(the_shell_command);
dojo.io.bind({
url: the_url,
load: function(type, data, evt){ printResult(data); },