出现的错误总结:
1,在选择登陆的时候出现:权限失效,解决办法:在Action中加上://学生登录
public String sdeng(){
List list=this.getIdengService().sdeng(xuehao, pass);
Map session=(Map) ActionContext.getContext().get("session");
if(list.size()>0){
Student student=((0);
String Sxuehao();
session.put("xuehao", xuehao);
session.put("list", list);
return "sok";
}
return "no";
}
//教师登录
public String tdeng(){
List list=this.getIdengService().tdeng(xuehao, pass);
Map session=(Map) ActionContext.getContext().get("session");
if(list.size()>0){
Teacher teacher=((0);
String Sxuehao();
session.put("xuehao", xuehao);
session.put("list", list);
return "tok";
}
return "no";
}
//管理员登入
public String adeng(){
List list=this.getIdengService().adeng(xuehao, pass);
Map session=(Map)ActionContext.getContext().get("session");
if(list.size()>0){
Admin admin=((0);
String Sxuehao();
session.put("xuehao", xuehao);
session.put("list", list);
return "aok";
}
return "no";
}
public int getQx() {
return qx;
}
public void setQx(int qx) {
this.qx = qx;
}
public String qxyz()
{HttpSession session = ServletActionContext.getRequest().getSession();
if(Attribute("rand")==null){
return "error";
}
//获得图形校验码
String sf = (String) Attribute("rand");
//如果图形校验码正确,判断帐号、密码是否正确
if(sf.equals(this.getYanzhengma())){
System.out.println(this.getQx());
if(this.qx==1)
{
return sdeng();
}
else
{
if(this.qx==2)
{
return tdeng();
}
else
{
return adeng();
}
}
}
else
return "error";
}
即可。
2,在学生查询个人资料出现:比如A登陆,但是在查询资料,出现的是查询数据库的第一条记录。
错误原因: <li><a href="sgrgl.action" target="rightFrame">个人资料</a></li>
解决办法: <li><a href="sgrgl.action?sxuehao=<%=Sxuehao() %>" target="rightFrame">个人资料</a></li>
3,在学生发布公告时候:出现;
Struts Problem Report
Struts has detected an unhandled exception:
Messages: | ∙There is no Action mapped for action name add. |
Stacktraces
There is no Action mapped for action name add. - [unknown location]
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
org.apache.struts2.ateActionProxy(StrutsActionProxyFactory.java:41)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:422)
session数据错误是什么意思 org.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
org.StandardContextValve.invoke(StandardContextValve.java:175)
org.StandardHostValve.invoke(StandardHostValve.java:128)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
org.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.tor.CoyoteAdapter.service(CoyoteAdapter.java:261)
http11.Http11Processor.process(Http11Processor.java:844)
http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at.util.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Unknown Source)
You are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set:
struts.devMode=false
in your WEB-INF/classes/struts.properties file.
错误原因:<li><a href="student/messageadd.jsp" target="rightFrame">我的留言</a></li>
解决办法:
<action name="userid" class="igerenAction" method="userxinxi">
<result name="success">student/messageadd.jsp</result>
</action>
<action name="add" class="istudentAction" method="ideaadd">
<result name="success">student/mok.jsp</result>
<result name="error">student/merror.jsp</result>
</action>
<li><a href="userid.action?sxuehao=<%=Sxuehao() %>" target="rightFrame">我的留言</a></li>
4.在修改密码的时候出现:比如原来密码是123,我把它修改为456后,它说修改成功,但是我在数据库查看是密码由原来的123变为了123456:
错误原因:jsp页面写错了name="Spass":
<p>原来密码:<input type="password" name="Spass" value="<%=Spass() %>"></p>
<p>修改后的密码:<input type="password" name="Spass"></p>
解决办法:
<p>原来密码:<input type="password" name="Spass1" value="<%=Spass() %>"></p>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论