<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" type="text/css" rel="stylesheet">
<title>首页</title>
</head>
<%@ taglib prefix="s" uri="/struts-tags" %>
以上是jsp代码,出现下图的错误,请问肿么回事?

解决方案 »

  1.   

    HTTP Status 500 - /Instance/22/22.1/WebContent/blog_main.jsp (line: 8, column: 41) File "/struts-tags" not foundtype Exception reportmessage /Instance/22/22.1/WebContent/blog_main.jsp (line: 8, column: 41) File "/struts-tags" not founddescription The server encountered an internal error (/Instance/22/22.1/WebContent/blog_main.jsp (line: 8, column: 41) File "/struts-tags" not found) that prevented it from fulfilling this request.exceptionorg.apache.jasper.JasperException: /Instance/22/22.1/WebContent/blog_main.jsp (line: 8, column: 41) File "/struts-tags" not found
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:133)
    org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:166)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1427)
    org.apache.jasper.compiler.Parser.parse(Parser.java:138)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)note The full stack trace of the root cause is available in the Apache Tomcat/7.0.28 logs.
    Apache Tomcat/7.0.28
      

  2.   

    最好这样写:<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*"errorPage="" %>
    <%@ taglib prefix="s" uri="/struts-tags" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href="css/style.css" type="text/css" rel="stylesheet">
    <title>首页</title>
    </head>
    还有你相关的Struts2的jar包加了吗
      

  3.   

    我对eclipe里文件夹的组织结构还是有点迷惑
    我没有用eclipse,不过在试一个eclipse的例子。我以前用的tomcat里的东西都是这样的结构:
    在tomcat指定的根目录下,放我的project文件夹
    第一层目录是
    <project>
    WEB-INFO文件夹
    web.xml
    <project/>
    然后在WEB-INFO文件夹里放的是
    <WEB-INFO>
    classes文件夹
    lib文件夹
    struts.xml
    </WEB-INFO>
    但是我从网上下的一个eclipse的文件夹目录是很奇怪的
    根目录下是三个文件夹
    WebContent文件夹
    build文件夹
    src文件夹而WEB-INFO这个文件夹是放在WebContent文件夹里,
    WEB-INFO里放的是lib文件夹和web.xml
    而strut.xml是放在build-〉classes文件夹里所以我就不知道这样tomcat怎样才能找到struts.xml这个文件。
      

  4.   

    eclipse中的web项目目录是
    <project>
    build文件夹
    src文件夹
    WebContent文件夹(WEB-INFO文件夹、web.xml)
    <project>
    WebContent文件夹是发布用的,给tomcat发布
      

  5.   

    你把webcontent里的东西拷贝到在tomcat的conf里的server指定的根目录下新建一个文件夹就行了
      

  6.   

    <%@taglib prefix="s" uri="/struts-tags"%>jsp里这句话加了没