Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-350 -- fixing more jsp references... added tests to check "/solr/" and "/solr/admin/threaddump.jsp"

Ryan McKinleybd9aeb7b5bfb
diff --git a/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java b/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
index 458306afa5a..ba52192d4c5 100644
--- a/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
+++ b/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
@@ -70,10 +70,13 @@ public class JettyWebappTest extends TestCase
// Currently not an extensive test, but it does fire up the JSP pages and make
// sure they compile ok
- String adminPath = "http://localhost:"+port+context+"/admin/";
+ String adminPath = "http://localhost:"+port+context+"/";
String html = IOUtils.toString( new URL(adminPath).openStream() );
assertNotNull( html ); // real error will be an exception
+ adminPath += "admin/";
+ assertNotNull( html ); // real error will be an exception
+
// analysis
html = IOUtils.toString( new URL(adminPath+"analysis.jsp").openStream() );
assertNotNull( html ); // real error will be an exception
@@ -81,5 +84,9 @@ public class JettyWebappTest extends TestCase
// schema browser
html = IOUtils.toString( new URL(adminPath+"schema.jsp").openStream() );
assertNotNull( html ); // real error will be an exception
+
+ // schema browser
+ html = IOUtils.toString( new URL(adminPath+"threaddump.jsp").openStream() );
+ assertNotNull( html ); // real error will be an exception
}
}
diff --git a/src/webapp/web/admin/threaddump.jsp b/src/webapp/web/admin/threaddump.jsp
index 3ce2d10cacc..74f4922fc22 100644
--- a/src/webapp/web/admin/threaddump.jsp
+++ b/src/webapp/web/admin/threaddump.jsp
@@ -21,22 +21,15 @@
java.lang.management.ThreadInfo,
java.io.IOException,
org.apache.solr.util.XML"%>
+<%@include file="_info.jsp" %>
+
<?xml-stylesheet type="text/xsl" href="threaddump.xsl"?>
-<%
- SolrCore core = (SolrCore) request.getAttribute("org.apache.solr.SolrCore");
- if (core == null) {
- String coreParam = request.getParameter("core");
- core = coreParam != null? org.apache.solr.core.SolrMultiCore.getInstance().getCore(coreParam) : null;
- }
- if (core == null)
- core = SolrCore.getSolrCore();
-%>
<%!
static ThreadMXBean tmbean = ManagementFactory.getThreadMXBean();
%>
<solr>
- <core><%=core.getName()%></core>
+ <core><%= collectionName %></core>
<system>
<jvm>
<version><%=System.getProperty("java.vm.version")%></version>
diff --git a/src/webapp/web/index.jsp b/src/webapp/web/index.jsp
index f61fe9561c4..a229c6d260d 100644
--- a/src/webapp/web/index.jsp
+++ b/src/webapp/web/index.jsp
@@ -28,7 +28,7 @@
<a href="."><img border="0" align="right" height="61" width="142" src="admin/solr-head.gif" alt="Solr"/></a>
<%
- org.apache.solr.core.MultiCore multicore = (org.apache.solr.core.MultiCore)request.getAttribute("org.apache.solr.core.MultiCore");
+ org.apache.solr.core.MultiCore multicore = (org.apache.solr.core.MultiCore)request.getAttribute("org.apache.solr.MultiCore");
if( multicore.isEnabled() ) {
for( org.apache.solr.core.SolrCore core : multicore.getCores() ) {%>
<a href="<%= core.getName() %>/admin/">Admin <%= core.getName() %> </a><br/>