当前位置:编程学习 > JAVA >>

求救

我的javaSSH的struts2跳转不会

求救啊:



这样的页面中的页面跳转不能成功

jsp页面:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<link href="../css/left.css" rel="stylesheet" type="text/css">
<body topmargin="0px">
<table width="100%" height="500"  border="0" cellpadding="0" cellspacing="0" bgcolor="#66FFCC">
  <tr>
    <td height="20"> </td>
  </tr>
  <tr>
    <td align="center" valign="top"> <table width="500" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/2005617193219610.jpg" bgcolor="#F5f7f7">
  <form name="form" method="post" action="addjobWanted">
    <tr align="center">
      <td height="27" colspan="2" bgcolor="#21536A"><div id="reg">发布求职信息</div></td>
    </tr>
    <tr>
      <td width="200" height="22" align="center">求职行业:</td>
      <td width="300" align="left"><input type="text" name="word.industry" value="不详"></td>
    </tr>
    <tr>
      <td height="22" align="center">所求职位:</td>
      <td align="left"><input type="text" name="word.jobName"></td>
    </tr>
    <tr>
      <td height="22" align="center">所求薪水:</td>
      <td align="left"><input type="text" name="word.salary" value="面议"></td>
    </tr>
    <tr>
      <td height="22" align="center">到期时间:</td>
      <td align="left"><input type="text" name="word.endTime">
      年-月-日</td>
    </tr>
    <tr>
      <td width="200" height="22" align="center">其他说明:</td>
      <td width="300" align="left"><textarea name="word.others" cols="35" rows="5">无</textarea></td>
    </tr>
    <tr align="center">
      <td height="35" colspan="2"><input type="submit" name="Submit" value="发布" >
  
        <input type="reset" name="Reset" value="重置"></td>
    </tr>
  </form>
</table></td>
  </tr>
</table>
</body>
</html>

struts2:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.ui.theme" value="simple" />
<constant name="struts.i18n.encoding" value="utf-8" />
<package name="struts2" extends="struts-default" namespace="/">
<action name="login" class="loginAction" method="login">
<result name="success" type="redirect">${type}/login.jsp</result>
<result name="input">login.jsp</result>
</action>
<action name="login" class="loginAction" method="login">
<result name="success" type="redirect">${type}/login.jsp</result>
<result name="input">login.jsp</result>
</action>
<action name="adminlogin" class="adminAction" method="login">
<result name="success" type="redirect">admin/admin.jsp</result>
<result name="input">login.jsp</result>
</action>
<action name="jobSeekerregister" class="jobSeekerAction" method="register">
<result name="success" type="redirect">login.jsp</result>
<result name="input">../jobSeeker/index.jsp</result>
</action>
<action name="companyregister" class="companyAction" method="register">
<result name="success" type="redirect">login.jsp</result>
<result name="input">../company/index.jsp</result>
</action>
<action name="addjobWanted" class="jobWantedAction" method="addjobWanted">
<result name="success" type="redirect">jobSeeker/ajobinfo_success.jsp</result>
<result name="input">../jobSeeker/ajobinfo_success.jsp</result>
</action>
<action name="selectbyj" class="jobSeekerAction" method="find">
<result name="success" type="redirect">jobSeeker/reginfo.jsp</result>
<result name="input">../jobSeeker/index.jsp</result>
</action>
<action name="updatejobSeeker" class="jobSeekerAction" method="update">
<result name="success" type="redirect">jobSeeker/reginfo_success.jsp</result>
<result name="input">../jobSeeker/reginfo.jsp</result>
</action>
</package>
</struts>    


从中发现,传的是对的,也能进入Struts2,其实,可是不能跳转到jobWantedAction中......

还有spring中的jobWantedAction也是对的,如下:
<bean id="jobWantedAction" class="com.java.action.JobWantedAction" scope="prototype" autowire="byName">
</bean>

难道是因为jsp页面是页面中的页面?

主页面:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<frameset rows="70,*" cols="*" frameborder="NO" border="0" framespacing="0">
  <frame src="top.htm" name="topFrame" scrolling="NO" noresize>
  <frameset rows="*" cols="178,*" framespacing="0" frameborder="no" border="0">
    <frame src="left.htm" name="leftFrame" scrolling="NO" noresize>
    <frame src="login.htm" name="mainFrame">
  </frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>

左边的:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/left.css" rel="stylesheet" type="text/css">
</head>
<body  topmargin="0px" >
<table width="18804%"  border="0" align="right" cellpadding="0" cellspacing="0" background="../images/20050912173655319.jpg">
      <tr>
        <td><table width="100%"  border="0" cellpadding="0" cellspacing="0" >
            <tr>
              <td height="27"><div id="font1">基本信息管理</div></td>
            </tr>
            <tr>
              <td height="22"><div id="link2"><a href="selectbyj" target="mainFrame">修改个人信息</a></div></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%"  border="0" cellpadding="0" cellspacing="0" >
          <tr>
            <td height="27"><div id="font1">邮件管理</div></td>
          </tr>
          <tr>
            <td height="22"><div id="link2"><a href="../mail" target="mainFrame">发送邮件</a></div></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="27" ><div id="font1">求职信息管理</div></td>
          </tr>
          <tr>
            <td height="22"><div id="link2"><a href="vjobinfo.jsp"  target="mainFrame">删除求职信息</a></div></td>
          </tr>
          <tr>
            <td height="22"><div id="link2"><a href="ajobinfo.jsp" target="mainFrame">发布求职信息</a></div></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="275"> </td>
      </tr>
</table></body>
</html>


跳转到的添加页面上面有

望大神求救!!!! --------------------编程问答--------------------

求救求救,分必给 --------------------编程问答-------------------- 你得把问题描述更详细些,丢这多代码   谁也不知道重点是哪一段玩不转 --------------------编程问答-------------------- --------------------编程问答-------------------- 这个.........不能编辑的啊.........


就是那个action跳转不成功,达不到预期效果.......


jsp页面提交action到struts2,struts2提交到action,可是.....struts2没有提交到action,可是javaSSH中的SSH都没错........

我就问:是不是因为是页面中的页面跳转问题.....

上面的jsp中提交的action是:addjobWanted........

struts接收需要的是addjobWanted,struts中的action是jobWantedAction

而在Spring中的是jobWantedAction......

其实上面我写的蛮明白的,只是文字都没加粗变色,你们都没看,以为都是代码......我的错

就那样了,求救是不是因为页面中的页面跳转,是不一样的,那个是那样错误的话,又怎么搞

--------------------编程问答-------------------- 超急的啊 --------------------编程问答-------------------- 求救了........大婶们,不能见死不救啊 --------------------编程问答-------------------- <result name="success" type="redirect">jobSeeker/ajobinfo_success.jsp</result>
 <result name="input">../jobSeeker/ajobinfo_success.jsp</result>

请求action成功的话那就是返回的路径错了,或者修改为type="freakmar",自己调试下 --------------------编程问答-------------------- 你的路径写错了,返回的页面在框架内的话type也应该要改 --------------------编程问答--------------------
引用 8 楼 wsx_java2011 的回复:
你的路径写错了,返回的页面在框架内的话type也应该要改


其实,我没错........

昨天晚上,我重启电脑,在打开MyEclipse就能运行了,其实完全没错,不过还是谢谢你了

我的完全没错的,没写错 --------------------编程问答--------------------
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,