eclipse struts jsp编译出错,网上没见有答案!!!

leemingking 2008-02-13 06:57:25
我遇到个这样的问题,网上找遍了也没有解释,郁闷中...那位高手不吝赐教
我用的是tomcat5.5+eclipse3.1+struts1.2.9+mysql+mysql-connector-java-3.1.6-bin.jar
login.jsp
<%@ page contentType="text/html;charset=GB2312" language="java" %>

<html>
<head>
<title>the simple login example</title>
</head>
<body>
<form action="login.do" method="post">
用户名:<INPUT type="text" name="userName" size="19"><BR>
密 码:<INPUT type="password" name="password" size="20"><BR><BR>
         
 <INPUT type="submit" value="提交">
<INPUT type="reset" value="重置">
</form>

</body>
</html>
=========================================================================
报错:
package org.apache.jsp.pages.chapterThree;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class login_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {

private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

private static java.util.List _jspx_dependants;

private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;


public Object getDependants() {
return _jspx_dependants;
}

public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}

public void _jspDestroy() {
}

public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {

PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;


try {
response.setContentType("text/html;charset=GB2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;

out.write("\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write(" <title>the simple login example</title>\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
out.write("\t\t<form action=\"login.do\" method=\"post\">\r\n");
out.write("\t\t\t\t 鐢ㄦ埛鍚嶏細<INPUT type=\"text\" name=\"userName\" size=\"19\"><BR>\r\n");
out.write("\t\t\t\t 瀵嗐�鐮侊細<INPUT type=\"password\" name=\"password\" size=\"20\"><BR><BR> \r\n");
out.write("\t\t\t\t          \r\n");
out.write("\t\t\t\t <INPUT type=\"submit\" value=\"鎻愪氦\">\r\n");
out.write("\t\t\t\t<INPUT type=\"reset\" value=\"閲嶇疆\">\r\n");
out.write("\t\t</form>\r\n");
out.write("\t\t\r\n");
out.write("\t</body>\r\n");
out.write("</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
===========================================================
报错分别是:
javax.el cannot be resolved to a type
org.apache.AnnotationProcessor cannot be resolved to a type
_el_expressionfactory cannot be resolved
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
_jsp_annotationprocessor cannot be resolved


那位高手能不吝赐教,小弟没齿不忘!!!!!!!


...全文
756 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
bsbbt 2008-04-29
  • 打赏
  • 举报
回复
请问,怎么我的Tomcat6.0下没有shared这个文件夹的?
pinkcoco 2008-02-14
  • 打赏
  • 举报
回复
在eclipse里面,检查一下你的JDK和TOMCAT是否配置正确

成功的话,eclipse可以自动把项目发布到TOMCAT中,就不用自己操心了
老紫竹 2008-02-14
  • 打赏
  • 举报
回复
leemingking 2008-02-13
  • 打赏
  • 举报
回复
谢谢java2000_net,终于成功了,但为什么eclipse里还是报错呢?我是把工程放到webapps下运行成功的,eclipse里要怎么配置呢?再次请教
老紫竹 2008-02-13
  • 打赏
  • 举报
回复
你报javaee 里面的jar支持类库复制到
tomcat/shared/lib
下面即可!
thankgb 2008-02-13
  • 打赏
  • 举报
回复
是不是你的WEB工程在配置的时候什么地方没有配置好,你再检查下

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧