按很多网上写的,设置了所有东西,猫页也出来 了
webapps\test
在webapps下建立test,同时web-inf也建了,在同级弄了个test.jsp怎么弄,也没法显示出来,报错如下:
説明 The server encountered an internal error () that prevented it from fulfilling this request.例外 org.apache.jasper.JasperException: /hello.jsp(3,3) 無効な指示子です
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:90)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:506)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)--------------------------------
弄到ROOT下,报错:メッセージ /test.jsp説明 The requested resource (/test.jsp) is not available.

解决方案 »

  1.   

    <%@ page language="java" contentType="text/html; charset=Shift_JIS"
        pageEncoding="Shift_JIS"%>
    <%@page Import="java.util.*" %>>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <title>Insert title here</title>
    </head>
    <body>
    <%out.println("aa"); %>
    </body>
    </html>
      

  2.   

    访问路径错了吧,提示没找到文件呀,是http://localhost:8080/test.jsp吗,建议看看tomcat的log提示看看部署成功了吗,最好使用tomcat的部署工具
      

  3.   

    http://localhost:8080/test/test.jsp
      你的路径是不是应该这样?
      

  4.   

    好了,好了,跟我做吧:
    1、把你的test移走
    2、在webapps下建立demo文件夹(所有字母注意大小写哦)
    3、在demo下建立WEB-INF文件夹(所有字母注意大小写哦)
    4、生成web.xml文件,放在WEB-INF下,内容:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" 
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    </web-app>
    5、生成个test.jsp文件,放在demo下,内容:
    <% out.print("aa"); %>
    6、启动Tomcat
    7、在浏览器中输入
    http://localhost:8080/demo/test.jsp
      

  5.   

    请问访问页面时,http://localhost:8080/test/test.jsp
    得到如下结果,请问怎么回事?
    --------------------------
    <%@ page language="java" contentType="text/html; charset=windows-31j"
        pageEncoding="windows-31j"%>
    <%@Page Import="java.util.*"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
    <title>Insert title here</title>
    </head>
    <body>
    <center>welcome</center>
    <br>
      <%!int angles[]={0,30,45,75,90};%>
        <TABLE BORDER="4" ALIGN="center">
        <th>ang</th>
        <th>Sine of angle</th>
           <%for(int i=0;i<5;i++){%>
           <TR>
           <td><%=angles[i]%></td>
           
           <td><%=Math.sin(Math.toRadians(angles[i]))%>
           </TR>
           <%}//end for loop%>
         </table>
    <%
    out.println("aaa");
    %>
    </body>
    </html>
      

  6.   

    真厉害
    你是怎么做到的?教教我。学习ing
      

  7.   

    <%@ page language="java" contentType="text/html; charset=Shift_JIS"
        pageEncoding="Shift_JIS"%>
    <%@page Import="java.util.*" %>>
                                                  ^^^
    你这个代码多个结尾多了个">"
      

  8.   

    <%@Page Import="java.util.*"%>
    import应该小写
      

  9.   

    JAVA环境还有问题啊
    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
    这些是什么啊,你用日语吗,不是和你说了,这个文件就写一句代码<% out.print("aa"); %>试试
      

  10.   

    网上的全是残缺不全文章  请买<JSP编程技巧集锦>里面的代码全是测试过拷贝下来就能运行!联系:fz [email protected]
      

  11.   

    最简单的方法就是用Eclipse配置多好啊  但是这样的程序出问题要是不能解决很危险啊  做jsp的话异常多的是,我当初做的时候真的很多,最后不过都好了,遇到异常自己解决是财富啊