弄了一个上午了,还是没点用!!!!!
网上说放哪我都放了,shared/lib下,WEB-INF/lib(项目)下,common/lib下,可是都还是没用啊,真郁闷,
我的servlet代码如下:
package myServlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.jspsmart.upload.SmartUpload;//报错...
public class Company_Servlet extends javax.servlet.http.HttpServlet implements
  javax.servlet.Servlet{
 
 /**
  * 
  */
 private static final long serialVersionUID = -201651203664101197L;
 /**
  * 
  */
 
 public Company_Servlet(){
  super();
 }
 
 public void doPost(HttpServletRequest request,HttpServletResponse response) throws
                ServletException,IOException{
  response.setContentType("text/html;charset=gb2312");
  com.jspsmart.upload.SmartUpload mySmartUpload = new   com.jspsmart.upload.SmartUpload();//报错,,,,,,
   String method=request.getParameter("method");
   String mycompanyName=request.getParameter("companyName");
   String mycompanyType=request.getParameter("companyType");
   String mymainProduct=request.getParameter("mainProduct");
   String mycreateTime=request.getParameter("createTime");
   String myprovince=request.getParameter("province");
   String mycity=request.getParameter("city");
   System.out.print(request.getParameter("companyName"));
   System.out.print(mymainProduct);
   
 
 }
 public void doGet(HttpServletRequest request,HttpServletResponse response) throws
    ServletException,IOException{
  doPost(request,response);
 }
}
是我的代码错了,还是我的jspSmartUpload.jar放错了位置,
哪位好人能告诉我啊?
----------------解决方案--------------------------------------------------------
加入classpath是可以的,试过了;
你再查查看jspSmartUpload.jar有没有添加正确了;
----------------解决方案--------------------------------------------------------
import com.jspsmart.upload.SmartUpload;
应该不会错的;
[此贴子已经被作者于2007-11-9 11:27:50编辑过]
----------------解决方案--------------------------------------------------------
dev的时候直接加在ide下,运行的时候放工程下就行了
----------------解决方案--------------------------------------------------------
我以前也有这样的问题啊,我之后看到我们的项目经理是把它放在工程下的lib文件夹下的
----------------解决方案--------------------------------------------------------
放在WEB-INF/lib(项目)和 common/lib下都是可以的,这样就不用在程序中用import 了,可以直接使用..
----------------解决方案--------------------------------------------------------
用eclipse的话不用考虑这个问题 直接添加jar文件到lib目录下 你的路径是对的 服务器和项目里面都要添加
----------------解决方案--------------------------------------------------------
就是,以前我也迷惑,不过现在好了,应该是放在LIB下的,还要在工程中再次引入才可以,用的时候要注意包名是不是对的啊!
----------------解决方案--------------------------------------------------------