html - Render an HTML <html> Element 
Renders an HTML <html> element with language attributes extracted from the user's current Locale object, if there is one.
 
Attribute Name Description 
lang Since: Struts 1.2Renders a lang attribute with the locale stored in the user's session. If not found in the session, the language from the Accept-Language HTTP header is used. If still not found, the default language for the server is used. (RT EXPR)  
locale DEPRECATED: Creating a session is undesirable for apps that don't support them. Use the lang attribute to acheive the same functionality without creating a session. Set to true in order to store a Locale in the session based on the current request's Accept-Language header (if any) if none has currently been set. This attribute will create a session if one does not already exist. The lang attribute is rendered with the appropriate language code.(RT EXPR)  
xhtml Since: Struts 1.1Set to true in order to render xml:lang and xmlns attributes on the generated html element. This also causes all other html tags to render as xhtml. (RT EXPR)  
 

解决方案 »

  1.   

    <html:submit>不管里面的onclick调的js结果如何肯定会submit form的
    建议楼主先明白html中的
    <input type="button">和<input type="submit">的区别
      

  2.   

    我明白的,但我想当JS中验证通过了的时候才submit form,所以就用<html:button >,但是会出错呀,告诉我没有这个属性和方法??,郁闷中大家帮忙解决我提的3个问题呀,谢谢,我在线等
      

  3.   

    问题1:
    if (Trim(jpsw) != Trim("${commVar.PASSWORD}"))trim应该是jpsw.trim()吧??
    问题2:
    img我一般是这样用的
    <img src="<bean:write name="imgForm" src="imgSrc">">
    问题3:
    这个更简单
    <frame name="BottomFrame" src="sq_bottom.do" scrolling="auto">
    看明白了吗?
      

  4.   

    问题1:
    if (Trim(jpsw) != Trim("${commVar.PASSWORD}"))trim应该是jpsw.trim()吧??
    ======================================
    这些是没错误的,我写了这样的方法的,不用关心这个的,我只是问为什么<html:button >的时候就出错??
      

  5.   


    <html:button value="确  定" property="submit" onclick="javascript: return compare();" />
    <script language="javascript">
    function compare()

             var pswchk = document.pswForm;
    var jpsw = pswchk.jpsw.value;
    if (Trim(jpsw) != Trim("${commVar.PASSWORD}"))
    {
    alert("旧口令输入错误!");
                      pswchk.jpsw.focus();
                      return false;
    }         pswchk.submit();
    }
    </script>
      

  6.   

    楼主还是不行呀,我发出来大家看看为什么不行这段代码,如果改成<html:submit>就行
    <%@ page contentType="text/html; charset=GBK" isELIgnored="false"%>
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %><bean:define id="commVar" name="CommonVar" scope="session" type="com.jtpsoft.gjjmx.CommonVar" />
    <bean:define id="CurrentDwxx" name="CurrentDwxx" scope="session" type="com.jtpsoft.gjjmx.CurrentDwxx" /><html>
    <head>
    <title>
    kl
    </title>
    <LINK REL="stylesheet" type="text/css" href="../../css/jtpsoft.css"/>
    <script language="JavaScript" src="../../script/swapimage.js"></script>
    <script language="JavaScript" src="../../script/String.js"></script>
    <script language="javascript">
    function window_onload()
    {
        var pswchk = document.pswForm;
    pswchk.user.value = "${commVar.USER}";
    pswchk.user.style.backgroundColor = "#C0C0C0";
    pswchk.user.readOnly = true;
    }
    function doreset()
    {
      top.MainFrame.location.href = "index.jsp";
    }
    function compare()

             var pswchk = document.pswForm;
    var jpsw = pswchk.jpsw.value;
    if (Trim(jpsw) != Trim("${commVar.PASSWORD}"))
    {
    alert("旧口令输入错误!");
                      pswchk.jpsw.focus();
                      return false;
    }         pswchk.submit();
    }
    </script>
    </head>
    <body leftmargin="0" topmargin="0" onload="window_onload()">
     <font color="red">
      <html:errors />
     </font>
    <html:form action="pswchg.do" >
    <table>
    <tr><td colspan="2" align="center" height="50">&nbsp;&nbsp;用户名称&nbsp;<html:text property="user"   /></td></tr>
    <tr><td colspan="2" align="center" height="50">输入旧口令<html:password property="jpsw"/></td></tr>
    <tr><td colspan="2" align="center" height="50">输入新口令<html:password property="xpsw1"/><br>
    <font color="green">1、口令长度至少6位;2、使用字母与数字的组合</font>
    </td></tr>
    <tr><td colspan="2" align="center" height="50">重复新口令<html:password property="xpsw2"/></td></tr>
    <tr>
    <tr><td align="center">
    <html:button value="确  定" property="submit" onclick="javascript: return compare();"  />
    </td>
    <td align="center"><html:reset value="重  置" onclick= "doreset()"/></td></tr>
    </tr>
    </table>
    </html:form>
      

  7.   

    上面的还是有些不完整,这不是主要的,后台打印出这样的错误:
    [DEBUG] 08:58:15.188  Looking for ActionForm bean instance in scope 'request' un
    der attribute key 'pswForm'
    [DEBUG] 08:58:15.188  Creating new ActionForm instance of type 'com.jtpsoft.gjjm
    x.actionform.PswForm'
    [DEBUG] 08:58:15.188  --> com.jtpsoft.gjjmx.actionform.PswForm@dc4c81
      

  8.   

    to:cxc010 那错了啊???上面的一段有吗?