关于程序运行出错,大家可能觉得我说的不详细.
其实我就建立一个tomcat项目,添加struts支持,然后就增加了一个struts JSP File,名字为newfile.jsp.代码如下:
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-nested" prefix="nested" %><html:html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
<title></title>
</head>
<body>
ddddddddddddddddd
</body>
</html:html>
其他啥代码都没写啊,运行就出以下错误HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPGenerated servlet error:
E:\Java\eclipse\workspace\kkkk\work\org\apache\jsp\newfile_jsp.java:7: cannot access java.lang.Object
Generated servlet error:
bad class file: C:\Program Files\Java\jre1.5.0_05\lib\rt.jar(java/lang/Object.class)
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
public final class newfile_jsp extends org.apache.jasper.runtime.HttpJspBas
             ^
1 error希望各位大侠指点.谢谢

解决方案 »

  1.   

    我的情况跟你一样,也是搞.net的
    最近想学习学习java
    报的错误也一样
    就弄页面跳转就研究了一天了,死活出不来
    就像这种:
    <action path="/aFullAction"
    type="somePackage.someActionClass">
    name="someForm"
    input="someJSP.jsp"
    <forward name="successful" path="someJSP.jsp"/>
    <forward name="failed" path="someOtherJSP.jsp"/>
    </action>
      

  2.   

    将 eclipse 结合 MyEclipse 插件使用。网上搜搜,很容易找到入门使用的方法。
      

  3.   

    你有在web.xml配置taglib了吗?
    按照你的写法,应该是写成
    <taglib> 
         <taglib-uri>="/tags/struts-bean</taglib-uri>  
         <taglib-location>/WEB-INF/lib/taglib/struts-bean.tld</taglib-location>
    </taglib> 
     其中<taglib-location></taglib-location>值是你的tld文件所在的物理位置,另外三个配置也要写上去。这样应该没问题了(当然你的action和actionform和struts-config.xml也要配置正确)
      

  4.   

    actionform一定要保证属性要不少于form的字段(即form有的,actionform一定也要有),而且要有相应的getXX setXX等等
      

  5.   

    楼主写的怎么是struts呢,只是一个jsp页面而已啊,报错的原因是你的路径错误,服务器根本没有找到你的那个newfile.jsp!个人感觉现在最好的开发工具是Eclipse,也有提示,配置主要是配置xml文件!