Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 294
  • Last Modified:

Class Call Failure

My call to a class does nothing!  (I'm trying to write rows to a table.)  My environment is...

- Start Tomcat
- Start browser and invoke index.jsp
- Click on link taking me to Application_EnterEdit.html
- Call to java class populates table (what doesn't work)

Here's the top of Application_EnterEdit.html...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="gov.vha.hvm.deliveryservice.scs.jsp.Subscriptioncalls" %>
<%@ page import="java.io.Writer" %>
<html>
<head>
<title></title>


In Application_EnterEdit.html, here's my call to the java class...

<table id="appList" class="sortable" cellspacing="10">
<thead>
<tr>
     <th>Name</th>
     <th>Description</th>
</tr>
</thead>
<tbody>
<% Subscriptioncalls.tblLoadApps(out); %>            <--- right here
</tbody>
</table>

Here's my class...

package gov.vha.hvm.deliveryservice.scs.jsp;

import java.io.IOException;
import java.io.Writer;

public class Subscriptioncalls {
 
  public static void tblLoadApps(Writer out){
         try {
            out.write("<tr><td>abc</td><td>def</td></tr>\n");
        } catch (IOException e) {
            e.printStackTrace();
        }
  }
}

What am I doing wrong?  Why aren't rows added to table?
0
LarryAndro
Asked:
LarryAndro
  • 4
  • 3
1 Solution
 
CEHJCommented:
It should be a jsp file. Is it html?
0
 
LarryAndroAuthor Commented:
I'll change from html to jsp.  

Whether that fixes the problem or not, that makes sense... I take it you can't shell out to a java class from a html.  Right?

Thx, LJA
0
 
CEHJCommented:
>>I take it you can't shell out to a java class from a html.  Right?

Right. html files are not compiled into servlets. jsp files are
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LarryAndroAuthor Commented:
Now, I'm getting the following error message?  Any ideas?
Thx...

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: org/apache/jsp/Index_jsp (wrong name: org/apache/jsp/index_jsp)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:256)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


root cause

java.lang.NoClassDefFoundError: org/apache/jsp/Index_jsp (wrong name: org/apache/jsp/index_jsp)
      java.lang.ClassLoader.defineClass0(Native Method)
      java.lang.ClassLoader.defineClass(ClassLoader.java:539)
      java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
      java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
      java.net.URLClassLoader.access$100(URLClassLoader.java:55)
      java.net.URLClassLoader$1.run(URLClassLoader.java:194)
      java.security.AccessController.doPrivileged(Native Method)
      java.net.URLClassLoader.findClass(URLClassLoader.java:187)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:192)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:110)
      org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:585)
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


note The full stack trace of the root cause is available in the Tomcat logs.

0
 
LarryAndroAuthor Commented:
Figured it out.  Here's the error...

javax.servlet.ServletException: org/apache/jsp/Index_jsp (wrong name: org/apache/jsp/index_jsp)
 
I noticed the different case of the name... Index vs index.  So, I stopped server, browser, and deleted all files in C:\Tomcat\work\Catalina\localhost\SCS\org\apache\jsp.  When I restarted, everything worked.
0
 
LarryAndroAuthor Commented:
CEHJ, thanks for the html should be jsp help!
0
 
CEHJCommented:
:-)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now