在maven项目下新建package时候找不到package选项

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/hxy199421/article/details/81366021

在maven项目下新建package时候找不到package选项

    

    解决方法:

        1、修改包的属性:

            

        2、然后再点击new就可以看到了:

            

展开阅读全文

JB找不到我的package !

06-21

我用的Jbuilder7 为什么在编译servlet时rnimport com.zbl.servlets.*;rn总是这里错!rn我用其它方法却能通过编译(Jcreator)。我的JB是不是要配置呢? 请大家帮我看看。谢谢!rnrn最气人的是Tomcat也找不到mypackage,下面是这个例子:rnrnimport com.zbl.beansCharge.Charge;rnrnimport java.util.Enumeration;rnimport java.util.Hashtable;rnrnimport java.io.PrintWriter;rnimport java.io.IOException;rnrnimport javax.servlet.ServletConfig;rnimport javax.servlet.ServletContext;rnimport javax.servlet.ServletException;rnrnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpSession;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnpublic class TimeServlet3 extends HttpServletrn public void init()rn log("init was called");rn rn public void doGet(HttpServletRequest reques,rn HttpServletResponse response)throws ServletException,rn IOExceptionrn log("doGet called");rn response.setContentType("text/html");rn PrintWriter out=response.getWriter();rn out.println("");rn out.println(" ");rn out.println("Time Entry System");rn out.println("");rn out.println("");rn out.println(" ");rn out.println(" ");rn HttpSession session=reques.getSession();rn String event=reques.getParameter("EVENT");rn if(event==null)rn event="ENTER_RECORD";rn rn else if(event.equals(""))rn event="ENTER_RECORD";rn rn if(event.equals("ENTER_RECORD"))rn out.println(" Enter Charge Record ");rn out.println(" User Name");rn out.println(" project");rn out.println(" Hours");rn out.println(" Date");rn out.println("");rn out.println("");rn out.println("");rnrn else if(event.equals("NEW_RECORD"))rn out.println(" your charge has been saved");rn String name=reques.getParameter("name");rn String project=reques.getParameter("project");rn String date=reques.getParameter("date");rn String hours=reques.getParameter("hours");rn Charge c=new Charge();rn c.setName(name);rn c.setProject(project);rn c.setDate(date);rn c.setHours(hours);rnHashtable h=(Hashtable) session.getAttribute("charges");rnif(h==null)rn h=new Hashtable();rn session.setAttribute("charges",h);rnrnh.put(project,c);rnout.println("Recod detailes: ");rnout.println("Name="+name+",Project="+project+",Hours="+hours+",date="+date);rnrnelse if(event.equals("SUMMARY"))rn out.println("");rn Hashtable h=(Hashtable) session.getAttribute("charges");rn if(h!=null)rn out.println(" ");rn Enumeration charges=h.keys();rn while(charges.hasMoreElements())rn String proj=(String) charges.nextElement();rn Charge ch=(Charge) h.get(proj);rnrn out.println(" ");rn out.println("name="+ch.getName());rn out.println(",project="+proj);rn out.println(",hours="+ch.getHours());rn out.println("date="+ch.getDate());rn rn out.println(" ");rn rn rn else if(event.equals("ADMIN"))rn out.println(" Administration Information");rn out.println(" Webapp and Servlet Engine Info");rnrn ServletContext context=getServletContext();rn out.println(" ");rn // out.println(" last Modified:"+getLastModified(request));rn out.println(" Server Info:"+context.getServerInfo());rn out.println(" Major Version:"+context.getMajorVersion());rn out.println(" Minor Version:"+context.getMinorVersion());rnrn out.println(" Webapp Init Parameters:");rn Enumeration webappParams=getInitParameterNames();rn out.println(" ");rn while(webappParams.hasMoreElements())rn String paramName=(String)webappParams.nextElement();rn String paramValue=context.getInitParameter(paramName);rnrn out.println(" "+paramName+"="+paramValue);rn rn out.println("");rn out.println("Servlet Info");rn ServletConfig config=getServletConfig();rn out.println(" last Modified:"+getLastModified(reques));rn out.println(" Servlet Info:"+getServletInfo());rn out.println(" Servlet Name:"+config.getServletName());rn out.println(" Servlet Init Parameters:");rn Enumeration ServletParams=config.getInitParameterNames();rn out.println("");rn while(ServletParams.hasMoreElements())rn String paramName=(String)ServletParams.nextElement();rn String paramValue=config.getInitParameter(paramName);rn out.println(" "+paramName+"="+paramValue);rn rn out.println("");rn out.println("");rn rn out.println("");rn out.println("");rn out.println("");rn out.println("");rn out.println("");rn out.println(" ");rn out.println("");rn out.println("");rnrnpublic void doPost(HttpServletRequest request,HttpServletResponse response)rnthrows ServletException,IOExceptionrn log("dopost called");rn doGet(request,response);rnrnrnrnhttp://127.0.0.1:8080/examples/servlet/TimeServlet3 这样能通过!显示大慨内容如下:rnrnEnter Charge Record rnUser Name rnrnproject rnrnHours rnrnDate rn rn我输入数值然后提交,出现下面错误,rnrn 论坛

没有更多推荐了,返回首页