初学者简单问题——import找不到包 class路径没设置对,必须指向.\webapps\myweb\WEB-INF\classes 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to dclfoxman(foxmandcl) :在环境变量中(classpath)我没有添加包的路径,必要么?以下是我的源程序(CStep2Servelt.java)package customctrl;import javax.servlet.*;import javax.servlet.http.*;import java.io.*;import java.util.*;import java.sql.*;import customctrlm.* ; ----问题就在这里,是同customctrl同一级别的目录public class CStep2Servelt extends HttpServlet { private static final String CONTENT_TYPE = "text/html; charset=GBK"; //Initialize global variables public void init() throws ServletException { } //Process the HTTP Get request public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request , response); } //Process the HTTP Post request public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //PrintWriter out = response.getWriter(); String rtnURL = mapAction(request ,response); HttpSession session=request.getSession(true); session.setAttribute("UserID",request.getParameter("UserID")) ; //out.println( session.getAttribute("UserID") ); //response.sendRedirect(rtnURL); } /** * do the action map * * @param request * @param response * @return the next URL decide where to go * @throws ApplicationException when an error occured **/ public String mapAction(HttpServletRequest request , HttpServletResponse response ) { String rtnURL = null; String flag = null; try { StringBuffer sBuffer = new StringBuffer(); if ( request.getParameter("flag").equals("1") ) { sBuffer.append("/myweb/servlet/customctrl.customdis"); } rtnURL = sBuffer.toString(); } catch(Exception e) { rtnURL = "/myweb/jsp/customctrl/CStep2.jsp" ; } return rtnURL; }} 邮件多样式发送 急急急。。。。。。 把一个文本框的默认值显示为 系统时间 只要年月日怎么做啊 [ 请教 ] 如何在java代码中执行关闭tomcat服务器的操作 集群环境,上传文件过程中一个节点down掉 JSP中执行SQL语句的问题 jsp程序的执行 jsp运行问题 请高手指点一下:给一个好的方案 如何获得文件的类型呢? SQL 查询 !!紧急!!!在线等待! servlet中怎样获得上传的file
在环境变量中(classpath)我没有添加包的路径,必要么?以下是我的源程序(CStep2Servelt.java)package customctrl;import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import java.sql.*;import customctrlm.* ; ----问题就在这里,是同customctrl同一级别的目录public class CStep2Servelt extends HttpServlet
{
private static final String CONTENT_TYPE = "text/html; charset=GBK";
//Initialize global variables
public void init() throws ServletException
{
}
//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
doPost(request , response);
}
//Process the HTTP Post request
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//PrintWriter out = response.getWriter();
String rtnURL = mapAction(request ,response);
HttpSession session=request.getSession(true);
session.setAttribute("UserID",request.getParameter("UserID")) ;
//out.println( session.getAttribute("UserID") );
//response.sendRedirect(rtnURL);
}
/**
* do the action map
*
* @param request
* @param response
* @return the next URL decide where to go
* @throws ApplicationException when an error occured
**/
public String mapAction(HttpServletRequest request , HttpServletResponse response )
{
String rtnURL = null;
String flag = null;
try
{
StringBuffer sBuffer = new StringBuffer();
if ( request.getParameter("flag").equals("1") )
{
sBuffer.append("/myweb/servlet/customctrl.customdis");
}
rtnURL = sBuffer.toString();
}
catch(Exception e)
{
rtnURL = "/myweb/jsp/customctrl/CStep2.jsp" ;
}
return rtnURL;
}
}