티스토리 뷰

Sample Source

[SampleSource] findClass.jsp

빼인트 2009. 11. 26. 08:12
/**
    사용 목적 : 찾고자 하는 로딩된 class가 물리적으로 어디에 존재하는지 알고자 할 때 사용.
*/


<%@ page import="java.util.*"%>

<%
    String reqName = null;
    java.net.URL classUrl = null;

    reqName = request.getParameter("reqName");
    if (reqName == null || reqName.trim().length() == 0) {
        reqName = "";
    }
%>

<html>
<body onLoad="document.form1.reqButton.focus();">

<br><hr align=center><br>
[Example]<br>
Document Builder Factory - org.apache.xerces.jaxp.DocumentBuilderFactoryImpl<br>
SAX Parser Factory - org.apache.xerces.jaxp.SAXParserFactoryImpl<br>
Transformer Factory - org.apache.xalan.processor.TransformerFactoryImpl<br>
<br>
(ex) org.apache.xerces.jaxp.DocumentBuilderFactoryImpl<br>

<form action="findClass.jsp" name=form1>
<input type=text name="reqName" value="<%= reqName %>">
<input type=submit name=reqButton value="FIND">
</form>

<%
    if (reqName.trim().length() != 0) {
%>

[Search Result]
<br>
<%
  reqName = reqName.replace('.', '/').trim();
 reqName = "/" + reqName + ".class";
        classUrl = this.getClass().getResource(reqName);
        if (classUrl == null) {
            out.println(reqName + " not found");
        } else {
            out.println("<b>" + reqName + "</b>: [" +
classUrl.getFile() + "]\n"
);
        }
        out.println("<br>");

    }
%>


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함