LarryAndro
asked on
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.delive ryservice. scs.jsp.Su bscription calls" %>
<%@ 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.tblLoadA pps(out); %> <--- right here
</tbody>
</table>
Here's my class...
package gov.vha.hvm.deliveryservic e.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?
- 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.delive
<%@ page import="java.io.Writer" %>
<html>
<head>
<title></title>
In Application_EnterEdit.html
<table id="appList" class="sortable" cellspacing="10">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<% Subscriptioncalls.tblLoadA
</tbody>
</table>
Here's my class...
package gov.vha.hvm.deliveryservic
import java.io.IOException;
import java.io.Writer;
public class Subscriptioncalls {
public static void tblLoadApps(Writer out){
try {
out.write("<tr><td>abc</td
} catch (IOException e) {
e.printStackTrace();
}
}
}
What am I doing wrong? Why aren't rows added to table?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>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
Right. html files are not compiled into servlets. jsp files are
ASKER
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.ServletExcep tion: org/apache/jsp/Index_jsp (wrong name: org/apache/jsp/index_jsp)
org.apache.jasper.servlet. JspServlet .service(J spServlet. java:256)
javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 856)
root cause
java.lang.NoClassDefFoundE rror: org/apache/jsp/Index_jsp (wrong name: org/apache/jsp/index_jsp)
java.lang.ClassLoader.defi neClass0(N ative Method)
java.lang.ClassLoader.defi neClass(Cl assLoader. java:539)
java.security.SecureClassL oader.defi neClass(Se cureClassL oader.java :123)
java.net.URLClassLoader.de fineClass( URLClassLo ader.java: 251)
java.net.URLClassLoader.ac cess$100(U RLClassLoa der.java:5 5)
java.net.URLClassLoader$1. run(URLCla ssLoader.j ava:194)
java.security.AccessContro ller.doPri vileged(Na tive Method)
java.net.URLClassLoader.fi ndClass(UR LClassLoad er.java:18 7)
org.apache.jasper.servlet. JasperLoad er.loadCla ss(JasperL oader.java :192)
org.apache.jasper.servlet. JasperLoad er.loadCla ss(JasperL oader.java :110)
org.apache.jasper.JspCompi lationCont ext.load(J spCompilat ionContext .java:585)
org.apache.jasper.servlet. JspServlet Wrapper.ge tServlet(J spServletW rapper.jav a:177)
org.apache.jasper.servlet. JspServlet Wrapper.se rvice(JspS ervletWrap per.java:2 96)
org.apache.jasper.servlet. JspServlet .serviceJs pFile(JspS ervlet.jav a:301)
org.apache.jasper.servlet. JspServlet .service(J spServlet. java:248)
javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 856)
note The full stack trace of the root cause is available in the Tomcat logs.
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.ServletExcep
org.apache.jasper.servlet.
javax.servlet.http.HttpSer
root cause
java.lang.NoClassDefFoundE
java.lang.ClassLoader.defi
java.lang.ClassLoader.defi
java.security.SecureClassL
java.net.URLClassLoader.de
java.net.URLClassLoader.ac
java.net.URLClassLoader$1.
java.security.AccessContro
java.net.URLClassLoader.fi
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.JspCompi
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
javax.servlet.http.HttpSer
note The full stack trace of the root cause is available in the Tomcat logs.
ASKER
Figured it out. Here's the error...
javax.servlet.ServletExcep tion: 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\lo calhost\SC S\org\apac he\jsp. When I restarted, everything worked.
javax.servlet.ServletExcep
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\lo
ASKER
CEHJ, thanks for the html should be jsp help!
:-)
ASKER
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