[jboss-cvs] JBossAS SVN: r79598 - in branches/JBPAPP_4_2_0_GA_CP/varia/src: resources/jmx/html and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 16 13:55:42 EDT 2008
Author: fjuma
Date: 2008-10-16 13:55:42 -0400 (Thu, 16 Oct 2008)
New Revision: 79598
Modified:
branches/JBPAPP_4_2_0_GA_CP/varia/src/main/org/jboss/jmx/adaptor/html/HtmlAdaptorServlet.java
branches/JBPAPP_4_2_0_GA_CP/varia/src/resources/jmx/html/displayMBeans.jsp
branches/JBPAPP_4_2_0_GA_CP/varia/src/resources/jmx/html/style_master.css
Log:
JBPAPP-1218: Malformed filter strings now result in an error message being displayed in the JMX console instead of a 500 exception. This is the same behaviour that was implemented for JBAS-3406.
Modified: branches/JBPAPP_4_2_0_GA_CP/varia/src/main/org/jboss/jmx/adaptor/html/HtmlAdaptorServlet.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/varia/src/main/org/jboss/jmx/adaptor/html/HtmlAdaptorServlet.java 2008-10-16 17:00:03 UTC (rev 79597)
+++ branches/JBPAPP_4_2_0_GA_CP/varia/src/main/org/jboss/jmx/adaptor/html/HtmlAdaptorServlet.java 2008-10-16 17:55:42 UTC (rev 79598)
@@ -178,18 +178,29 @@
{
session.setAttribute(FILTER_PARAM, filter);
}
-
+
+ Iterator mbeans;
+
try
{
- Iterator mbeans = Server.getDomainData(filter);
- request.setAttribute("mbeans", mbeans);
- RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/displayMBeans.jsp");
- rd.forward(request, response);
+ mbeans = Server.getDomainData(filter);
}
catch(JMException e)
{
- throw new ServletException("Failed to get MBeans", e);
+ request.setAttribute("filterError", e.getMessage());
+ try
+ {
+ mbeans = Server.getDomainData("");
+ }
+ catch(JMException e1)
+ {
+ throw new ServletException("Failed to get MBeans", e1);
+ }
}
+
+ request.setAttribute("mbeans", mbeans);
+ RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/displayMBeans.jsp");
+ rd.forward(request, response);
}
/** Display an mbeans attributes and operations
Modified: branches/JBPAPP_4_2_0_GA_CP/varia/src/resources/jmx/html/displayMBeans.jsp
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/varia/src/resources/jmx/html/displayMBeans.jsp 2008-10-16 17:00:03 UTC (rev 79597)
+++ branches/JBPAPP_4_2_0_GA_CP/varia/src/resources/jmx/html/displayMBeans.jsp 2008-10-16 17:55:42 UTC (rev 79598)
@@ -27,7 +27,14 @@
</table>
<hr>
<form action="HtmlAdaptor?action=displayMBeans" method="post" name="applyFilter" id="applyFilter">
-ObjectName Filter (e.g. "jboss:*", "*:service=invoker,*") :<input type="text" name="filter" size="40" value="<%= request.getAttribute("filter")%>"> <input type="submit" name="apply" value="ApplyFilter">
+ObjectName Filter (e.g. "jboss:*", "*:service=invoker,*"):
+<input type="text" name="filter" size="40" value="<%= request.getAttribute("filter")%>">
+<%
+ if(request.getAttribute("filterError") != null) {
+ out.println("<span class='error'>" + request.getAttribute("filterError") + "</span>");
+ }
+%>
+<input type="submit" name="apply" value="ApplyFilter">
</form>
<hr>
<%
Modified: branches/JBPAPP_4_2_0_GA_CP/varia/src/resources/jmx/html/style_master.css
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/varia/src/resources/jmx/html/style_master.css 2008-10-16 17:00:03 UTC (rev 79597)
+++ branches/JBPAPP_4_2_0_GA_CP/varia/src/resources/jmx/html/style_master.css 2008-10-16 17:55:42 UTC (rev 79598)
@@ -31,6 +31,10 @@
}.bg_cell{
background-color : #ffffff;
}
+*.error {
+ color: red;
+}
+
A:ACTIVE {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
More information about the jboss-cvs-commits
mailing list