SSH框架不进action是怎么回事啊?

su_tata 2012-12-24 09:01:28
在学校好好的,然后把项目拿到公司里面来然后就不进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();">
...全文
316 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
su_tata 2012-12-25
  • 打赏
  • 举报
回复
问题解决了,是tomcat版本的事情,公司版本是5.5;我换6.0就什么都好使了
liangchengfck1 2012-12-24
  • 打赏
  • 举报
回复
& &
xxingchen_7 2012-12-24
  • 打赏
  • 举报
回复
改为 <result name="success" type="redirect">/这里应该是一个对应的Action名.action?pageIndex=1&sel=up</result>
sssskd 2012-12-24
  • 打赏
  • 举报
回复
这个问题好解决: 把你的表单请求方式 <s:form action="login" theme="simple" method="post" onsubmit="return loginf();"> 改成这样: <s:form action="/项目名/login" theme="simple" method="post" onsubmit="return loginf();"> 这样就没有问题了。
y1321735393 2012-12-24
  • 打赏
  • 举报
回复
你有没有配置拦截器
  • 打赏
  • 举报
回复
这典型的IDE验证问题,不是错。
雍寇德 2012-12-24
  • 打赏
  • 举报
回复
请求地址在那 你这个login方法都没有打印第一句 都没有进入 首先查地址 然后看是否被拦截 再看你的SSH spring配置初始化了否
ydj7501603 2012-12-24
  • 打赏
  • 举报
回复
确定下你的Package是否命名了, 请确定是否有拦截器,被拦截了 从你的配置文件看护是有拦截器的,请确定是否报错,或其他
su_tata 2012-12-24
  • 打赏
  • 举报
回复
引用 3 楼 fangmingshijie 的回复:
你报的什么错


  • 打赏
  • 举报
回复
你报的什么错
su_tata 2012-12-24
  • 打赏
  • 举报
回复
你的东西报错,亲
引用 1 楼 fangmingshijie 的回复:
改为 <result name="success" type="redirect">/selbyid.html?pageIndex=1&sel=up</result>
  • 打赏
  • 举报
回复
改为 <result name="success" type="redirect">/selbyid.html?pageIndex=1&sel=up</result>
su_tata 2012-12-24
  • 打赏
  • 举报
回复
谁不忙加我QQ我给发过去看一下也可以呀 29890597 备注csdn 3Q
su_tata 2012-12-24
  • 打赏
  • 举报
回复
我觉得应该是被拦截了,页面旁边有个注册链接,一点的话也是跳不到指定页面去

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧