你先把原先编译运行的程序关掉,在重新运行试试。因为Tomcat有时需要重新启动。
解决方案 »
- 问一下大家都用什么工具阅读java 源代码?
- 问一个字符串的问题,谢谢大家
- java.nio.channels.Selector 的问题 报IOException "Unable to establish loopback connection"
- 谁能给我一个下载地址啊~??
- 写了一快排发现随机数为一百的时候有bug不知道咋办了
- 如何在jb7中输入main(String[] args)中args的值????
- 请问如何在关闭窗口时,避免程序终止?
- 怎样输出双引号
- 在JAVA里面要如何才能调用外部命令???
- java有没有留一个永远不用的字符,高手请进!!!
- 终于有了4个绿三角了,高兴,散分!!!顺便问个个人小问题!
- 请问大家正在用什么JAVA IDE工具?
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import com.borland.internetbeans.*;public class MyServlet extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=GBK";
MyDataModule myDataModule1;
IxPageProducer ixPageProducer1 = new IxPageProducer();
//Initialize global variables
public void init() throws ServletException {
}
//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>MyServlet</title></head>");
out.println("<body>");
out.println("<p>The servlet has received a GET.This is the reply.  THE name is");
String name=request.getParameter("name");
out.println(name);
out.println(". This a reply.</p>");
out.println("</body></html>"); }
//Process the HTTP Post request
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>MyServlet</title></head>");
out.println("<body>");
out.println("<p>The servlet has received a GET.This is the reply.  THE name is");
String name=request.getParameter("name");
out.println(name);
out.println(". This a reply.</p>");
out.println("</body></html>");
}
//Clean up resources
public void destroy() {
} public MyServlet() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
myDataModule1 = servlet.MyDataModule.getDataModule();
ixPageProducer1.setDataModule(myDataModule1);
}
}
-----------------------------------
<html>
<head>
<title>Hello HTML</title>
</head>
<body>
<u>Hello my baby</u>
<form name="MyFrom" method="post" action="http://localhost:8080/WepAppication/MyServlet">
<table>
<tr><td>请输入你的名字:</td><td><input name="name" type="text" ></td></tr>
</table>
</form>
</body>
</html>
-------------action属性用的有问题
改成action="http://localhost:8080/servlet/MyServlet"试试。
找不到你调用的这个包。
最重要的是MySevlet出错。
按提示好像是找不到数据源,我的程序是不是哪里没有定义好数据的源的路径
或者访问的方法
你的另外一个类MyDataModule
里面引用了com.borland.dx.dataset.DataModule
而这个包也没有在classpath里,
在jbuilder里加进去就可以了。