日期:2014-05-18  浏览次数:20646 次

JSP+struts+hibernate开发在线考试管理系统时出错,请高手帮忙!!!
现在程序能进入运行界面,当相应的用户进入各用户功能界面后,进行下一步的功能操作时出错下面的错误:
type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

javax.servlet.ServletException: Couldn't find the role!
cn.hxex.exam.filter.HibernateFilter.doFilter(HibernateFilter.java:71)


root cause 

cn.hxex.exam.exception.ExamSystemException: Couldn't find the role!
cn.hxex.exam.struts.HxexRequestProcessor.processRoles(HxexRequestProcessor.java:96)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:197)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
cn.hxex.exam.filter.HibernateFilter.doFilter(HibernateFilter.java:49)
请问各位高手出错的原因是什么原因,是不是因为创建的数据表出错的原因!!



------解决方案--------------------
是因为你没有在配置文件中给这个角色赋权限.
在你的.XML配置文件中,有一个ACTION方法没有注册这个方法权限吧
cn.hxex.exam.filter.HibernateFilter.doFilter(HibernateFilter.java:71) 
 在这个方法里,是你们自己封装了.没有给这些用户权限.所以都进不去
------解决方案--------------------
最好把代码格式一下
XML code

<action-mappings>
    <action    path="/manage/classes"
          type="cn.hxex.exam.action.ClassesAction"  
          name="classesForm"    scope="request"  
      input="/manage/classes_add.jsp"    parameter="p"    unknown="false"    validate="false"     >
        <forward    name="add"    path="/manage/classes_add.jsp"    redirect="false"    />
        <forward    name="list"    path="/manage/classes_list.jsp"    redirect="false"    />
        <forward    name="update"    path="/manage/classes_update.jsp"    redirect="false"    />
        <forward    name="classes_teacher"    path="/manage/classes_teacher.jsp"    redirect="false"    />
    </action>
    <action    path="/manage/student"    type="cn.hxex.exam.action.StudentAction"    name="studentForm"    scope="request"    input="/manage/student_add.jsp"    parameter="p"    unknown="false"    validate="false"     >
        <forward    name="add"    path="/manage/student_add.jsp"    redirect="false"    />
        <forward    name="update"    path="/manage/student_update.jsp"    redirect="false"    />
        <forward    name="list"    path="/manage/student_list.jsp"    redirect="false"    />
    </action>
    <action    path="/exam/testpaper"    type="cn.hxex.exam.action.TestPaperAction"    name="testPaperForm"    scope="request"    input="/exam/testpaper_list.jsp"    parameter="p"    unknown="false"    validate="false"     >        <forward    name="add"    path="/exam/testpaper_add.jsp"    redirect="false"    />
        <forward    name="list"    path="/exam/testpaper_list.jsp"    redirect="false"    />
        <forward    name="update"    path="/exam/testpaper_update.jsp"    redirect="false"