用js + html 就可以了.

解决方案 »

  1.   

    只能用javascript吗?struts肯定提供这样的功能的。
      

  2.   

    <html:button property="这里可以不用添啊~这是你对应的formbean的属性" value=""
      onclick="页面" />
    没问题啊~~~`
      

  3.   

    不行啊,property不写的话,它出错,说这个属性是必须的。写上了,点击还是没反应啊?我的代码如下:<form>
    .....
    </form>
    <html:button property="" value="register" onclick="/RegAction.do"/>把上面这句写在form里也没用。
      

  4.   

    <html:button property="定义在表单被提交时返回到服务器的请求参数的名称" value="register" onclick="javascript:window.submit()">
    Struts功能暂时就提供到这,表单提交还要用javascript.
      

  5.   

    也就是说:<html:button property="reg" value="register" onclick="javascript:window.submit()">提交到的页面可以这样用 : 
    String reg = request.getParameter("reg");
    if ("register".equals(reg)) {
    提交后要做的动作!
    }
      

  6.   

    可我在表单中并没有对应该button的属性啊(也不需要),我只要实现简单的转页功能.
    你的写法似乎要来个中间页面来处理。好像记得是用document的,js不熟啊!帮我写一下吧:)
      

  7.   

    我现在这样写:
    <html:button property="" value="register" onclick="window.open('regEdit.do')"/>
    是可以了,可它打开了新窗口。我让它在原窗口打开。怎么办。window好像有个self熟行,可怎么用啊
      

  8.   

    如果你不是要把你的表单提交到另一个页面是可以的,你说的就是要提交到本页面,还是在本页打开另一页?
    this.jsp
    <html:from action="regEdit.do">
    <html:button property="reg" value="register" onclick="javascript:window.submit()">
    </html:form>
    根据你在action regEdit里的return (mapping.findForward("thisPage"));或
    return (mapping.findForward("otherPage"));将本页提交到本页或是另一页。如果你要不过怎样都不打开新的窗口也好办。<head>
    <script language="javascript">
    function thisWin() {
     window.location ="regEdit.do?action=thisPage"//可加参数
    }
    </script>
    </head>
    <html:from action="regEdit.do" name="regForm">
    <html:button property="reg" value="register" onclick="javascript:thisWin()">
    </html:form>
    在action regEdit里
    String action= rquest.getParameter("action");
    if ("thisPage".equals(action))
    return (mapping.findForward("thisPage"));//你想去什么地方就给去什么地方的参数。
    else 
    return (mapping.findForward("otherPage"));strut-config.xml    <action    path="/regEdit"
                   type="com.action.regEdit">
          <forward name="thisPage"              path="/this.jsp"/>
          <forward name="otherPage"               path="other.jsp"/>
        </action>