错误:
cn.com.jbaptech.javaoraprj.faqtool.CommandException: AddCommand:No Driver Available!
cn.com.jbaptech.javaoraprj.faqtool.AddCommand.execute(AddCommand.java:35)
cn.com.jbaptech.javaoraprj.faqtool.FaqAdminServlet.service(FaqAdminServlet.java:25)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
cn.com.jbaptech.javaoraprj.faqtool.CommandException: AddCommand:No Driver Available!
cn.com.jbaptech.javaoraprj.faqtool.AddCommand.execute(AddCommand.java:35)
cn.com.jbaptech.javaoraprj.faqtool.FaqAdminServlet.service(FaqAdminServlet.java:25)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
解决方案 »
- SSH开发输出少内容
- jsp与mysql的连接问题
- 请求高手帮忙了!!!!!!谢谢~~~~~~~~~~~~~~~~~~~~~
- jsp页面不正常显示,显示的是源代码,不是想要的效果.
- jsp 高手进吖。。。
- 一个服务器上的两个系统,怎么使一个系统调用另一个系统的session里的值?
- 在用poi读取excel数据时,为什么cell.getNumericCellValue()总是得到8.8888888E7(应该得到数字88888888才对)
- 关于页面输出html标签
- 100分求原码(上传下载.doc)
- java mysql 前端做一个考试系统
- 小白问javascript调用数据库的问题~~
- 在线数学公式的编辑器怎么实现,找了很多网上资料还是有些模糊,如果能帮实一功能实现我会重谢的。
错误:
at cn.com.jbaptech.javaoraprj.faqtool.AddCommand.execute(AddCommand.java:35)
at cn.com.jbaptech.javaoraprj.faqtool.FaqAdminServlet.service(FaqAdminServlet.java:25)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)AddCommand.java代码:
package cn.com.jbaptech.javaoraprj.faqtool;import javax.servlet.*;
import javax.servlet.http.*;public class AddCommand implements Command {
private String next; public AddCommand(String next) {
this.next = next;
} public String execute(HttpServletRequest req)
throws CommandException {
try {
if (CommandToken.isValid(req)) {
FaqRepository faqs = FaqRepository.getInstance();
FaqBean faq = new FaqBean();
faq.setQuestion(req.getParameter("question"));
faq.setAnswer(req.getParameter("answer"));
faqs.put(faq);
req.setAttribute("faqtool.msg", "FAQ Added Successfully");
}
else {
req.setAttribute("faqtool.msg", "Invalid Reload Attempted");
}
return next;
}
catch (FaqRepositoryException fe) {
throw new CommandException("AddCommand: " + fe.getMessage());
}
}
}FaqAdminServlet.java代码:
package cn.com.jbaptech.javaoraprj.faqtool;import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.http.HttpServlet.*;
import java.util.*;public class FaqAdminServlet extends HttpServlet {
private HashMap commands;
private String error = "error.jsp";
private String jspdir = "/faqtool/"; public void init(ServletConfig config) throws ServletException {
super.init(config);
initCommands();
} public void service(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException {
String next;
try {
Command cmd = lookupCommand(req.getParameter("cmd"));
next = cmd.execute(req);
CommandToken.set(req);
}
catch (CommandException e) {
req.setAttribute("javax.servlet.jsp.jspException", e);
next = error;
}
RequestDispatcher rd;
rd = getServletContext().getRequestDispatcher(jspdir + next);
rd.forward(req, res);
} private Command lookupCommand(String cmd)
throws CommandException {
if (cmd == null)
cmd = "main-menu";
if (commands.containsKey(cmd.toLowerCase()))
return (Command)commands.get(cmd.toLowerCase());
else
throw new CommandException("Invalid Command Identifier");
} private void initCommands() {
commands = new HashMap();
commands.put("main-menu", new NullCommand("menu.jsp"));
commands.put("abort", new AbortCommand("menu.jsp"));
commands.put("add", new NullCommand("add.jsp"));
commands.put("do-add", new AddCommand("menu.jsp"));
commands.put("update-menu", new GetAllCommand("upd_menu.jsp"));
commands.put("update", new GetCommand("update.jsp"));
commands.put("do-update", new UpdateCommand("menu.jsp"));
commands.put("delete-menu", new GetAllCommand("del_menu.jsp"));
commands.put("delete", new GetCommand("delete.jsp"));
commands.put("do-delete", new DeleteCommand("menu.jsp"));
}
}求救!!!!!!!!!!!!!
cn.com.jbaptech.javaoraprj.faqtool.CommandException: AddCommand:No Driver Available!
throws CommandException {
try {
if (CommandToken.isValid(req)) {
FaqRepository faqs = FaqRepository.getInstance();
FaqBean faq = new FaqBean();
faq.setQuestion(req.getParameter("question"));
faq.setAnswer(req.getParameter("answer"));
faqs.put(faq);
req.setAttribute("faqtool.msg", "FAQ Added Successfully");
}
else {
req.setAttribute("faqtool.msg", "Invalid Reload Attempted");
}
return next;
}
catch (FaqRepositoryException fe) {
throw new CommandException("AddCommand: " + fe.getMessage());
}
}
}
public String execute(HttpServletRequest req)throws CommandException {异常信息写的啊 没有有效的驱动