在学校好好的,然后把项目拿到公司里面来然后就不进action了
下面是部分代码,麻烦各位大神帮忙分析一下
action代码:public String login() {
System.out.println("----->+进来了么?");
userVo.setMess(null);
// request对象
HttpServletRequest request = ServletActionContext.getRequest(); try {
User user = ub.login(userVo.getUser());
if (user != null) {
request.getSession().setAttribute(Const.USER, user);
return Action.SUCCESS;
} else {
userVo.setMess("登陆失败!");
return Action.INPUT;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return Action.ERROR;
}struts配置文件代码:<action name="login" class="com.shop.action.UserAction" method="login">
<!-- 不拦截的调用-->
<interceptor-ref name="paramsPrepareParamsStack"/>
<!-- dispatcher:转发||redirect:重定向 -->
<result name="success" type="redirect">/selbyid.html?pageIndex=1&sel=up</result>
<result name="input">/login.jsp</result>
</action>前台form代码:<s:form action="login" theme="simple" method="post" onsubmit="return loginf();">
下面是部分代码,麻烦各位大神帮忙分析一下
action代码:public String login() {
System.out.println("----->+进来了么?");
userVo.setMess(null);
// request对象
HttpServletRequest request = ServletActionContext.getRequest(); try {
User user = ub.login(userVo.getUser());
if (user != null) {
request.getSession().setAttribute(Const.USER, user);
return Action.SUCCESS;
} else {
userVo.setMess("登陆失败!");
return Action.INPUT;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return Action.ERROR;
}struts配置文件代码:<action name="login" class="com.shop.action.UserAction" method="login">
<!-- 不拦截的调用-->
<interceptor-ref name="paramsPrepareParamsStack"/>
<!-- dispatcher:转发||redirect:重定向 -->
<result name="success" type="redirect">/selbyid.html?pageIndex=1&sel=up</result>
<result name="input">/login.jsp</result>
</action>前台form代码:<s:form action="login" theme="simple" method="post" onsubmit="return loginf();">
解决方案 »
- mysql5.1 &&1146错误如何解决,有无影响数据库存贮。
- red5集群成功的效果是什么啊?
- URL参数中包含%,如何在servlet中取到参数?
- 登陆验证问题
- 在resion中有javax.servlet.UnavailableException 错误 但是tomcat中没问题,各位朋友帮帮忙咯。
- Servlet小问题,就是看不懂啊,麻烦哪位大虾帮我看看,谢谢!
- 谁能提供一些webmail的资料(内详),走过路过都进来看看啊!!!
- cactus tests
- 想在jsp页面里面调用客户端的程序,java程序有但是不知如何写成bean,或者谁还有更好的办法。
- editplus可以在哪下载?
- hibernate 删除操作时自动插入空数据
- 来大神!!求swing界面和jsp界面的切换方法,就是在jsp里怎么写js语句实现点击按钮跳到swing界面去, swing主函数已写完,之前试了下网上说的在
请确定是否有拦截器,被拦截了
从你的配置文件看护是有拦截器的,请确定是否报错,或其他
都没有进入
首先查地址
然后看是否被拦截
再看你的SSH spring配置初始化了否
<s:form action="login" theme="simple" method="post" onsubmit="return loginf();">改成这样:
<s:form action="/项目名/login" theme="simple" method="post" onsubmit="return loginf();">这样就没有问题了。
29890597 备注csdn
3Q