Я пытаюсь вызвать метод класса Java из JSP. Но я получаю следующее сообщение об ошибке:
<[ServletContext @ 511217905 [приложение: модуль MyWAR: путь abcd: нулевая спецификация-версия: 3.1]] Первопричина ServletException. weblogic.servlet.jsp.CompilationException: не удалось скомпилировать JSP /something.jspthing.jsp: 224: 169: метод method_name (String) не определен для типа Classname </p>
У меня естькласс и метод Java представлены и скомпилированы и собраны правильно. Я также развернул приложение на своем веб-логическом сервере без каких-либо проблем. Теперь я пытаюсь использовать одну функцию в своем приложении, нажимая кнопку, и я получаю эту ошибку. Я использую Java 1.8 и Weblogic 12c.
Это мой JSP:
<%@page import="com.xyz.zaq.web.utils.Classname"%>
<% if(!allowmod) { %>
<td align="right"><%=SystemStrings.getParam6()%></td>
<%
if (!allowmod) {
%>
<td><input type="text" size="60" maxlength="255"
onkeypress="validateInputLength(this, 'P_A', event)" name="param6"
value="<%=Classname.encode(Classname.method_name(p6))%>"
readonly="readonly"></td>
<%
} else {
%>
<td><input type="text" size="60" maxlength="255"
onkeypress="validateInputLength(this, 'P_A', event)" name="param6"
value="<%=Classname.encode(p6)%>" readonly="readonly"></td>
<%
}
%>
StackTrace:
something.jsp:294:167: The method method_name(String) is undefined for the type Classname
<td><input type="text" size="60" maxlength="255" onkeypress="validateInputLength(this, 'P_A', event)" name="param10" value="<%=Classname.encode(Classname.method_name(p10))%>"
readonly="readonly"></td>^M
at weblogic.servlet.jsp.JavelinxJSPStub.reportCompilationErrorIfNeccessary(JavelinxJSPStub.java:247)
at weblogic.servlet.jsp.JavelinxJSPStub.compilePage0(JavelinxJSPStub.java:183)
at weblogic.servlet.jsp.JavelinxJSPStub.access$000(JavelinxJSPStub.java:50)
at weblogic.servlet.jsp.JavelinxJSPStub$1.run(JavelinxJSPStub.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.servlet.jsp.JavelinxJSPStub.compilePage(JavelinxJSPStub.java:108)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:267)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:218)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:414)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:304)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:489)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:376)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3702)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3672)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:328)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1705)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1665)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:652)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:360)
Пожалуйста, дайте мне знать, кто япропускаем.