作者forkome (乌龟)
看板java
标题[问题] JavaBean执行Thread问题
时间Mon Feb 27 17:10:58 2006
小弟在做硬体方面的控制,之前都是写Application
现在要弄成Bean时出现问题,不知是否网页上不能做这样的触发
使用Bean来触发硬体设备有人有这样做过吗?
以下是我想弄成Bean的程式
Bean的程式码
Class TestBean(){
.
.
.
public void start() {
AnalogChannel a = new AnalogChannel();
}
}
Thread程式码
public class AnalogChannel extends Channel implements Runnable
.
.
.
.
JSP程式码
<jsp:useBean id="test" class="mypackage.TestBean"/>
<jsp:setProperty name="test" property="dig" value="4652"/>
<jsp:setProperty name="test" property="filename" value="rocfatcat.wav"/>
<%
test.Start();
%>
会就出现
javax.servlet.ServletException: local/dialogic/AnalogChannel
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:822)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:755)
org.apache.jsp.test_jsp._jspService(test_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:268)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:258)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:205)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 210.71.14.201