当前位置: 代码迷 >> Java Web开发 >> 这个ACTION为啥刚进入页面执行了?代码贴出
  详细解决方案

这个ACTION为啥刚进入页面执行了?代码贴出

热度:5335   发布时间:2013-02-25 21:13:01.0
这个ACTION为什么刚进入页面执行了?代码贴出
jsp文件,为什么刚进这个页面的时候,就会去执行红色部分的“imageAction”ACTION啊?这个标签是自动提交的么?
XML code
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%><%@ taglib prefix="s" uri="/struts-tags"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>    <head>        <title>用户注册</title>        <script type="text/javascript">    function shuaxin(obj) {        var shijian = new Date().getTime();        obj.src = "imageAction.action?d=" + shijian;    }</script>    </head>    <body>        <h1 align="center">            用户注册        </h1>        <div align="center">            <s:fielderror cssStyle="color:red"></s:fielderror>            <s:actionerror cssStyle="color:red"></s:actionerror>            <br>            <s:form action="register" theme="simple" method="post">                <table width="50%" border="0" style="width: 501px; height: 342px;">                    <tr>                        <td align="right">                            账号:                        </td>                        <td width=20>                            <s:textfield name="username"></s:textfield>                        </td>                        <td>                            <font color="red" align="left">                                <h6>                                    *必填                                </h6> </font>                        </td>                    </tr>                    <tr>                        <td align="right">                            密码:                        </td>                        <td>                            <s:password name="password"></s:password>                        </td>                        <td>                            <font color="red" align="left"><h6>                                    *必填                                </h6> </font>                        </td>                    </tr>                    <tr>                        <td align="right">                            重复密码:                        </td>                        <td>                            <s:password name="repassword"></s:password>                        </td>                        <td>                            <font color="red" align="left"><h6>                                    *必填                                </h6> </font>                        </td>                    </tr>                    <tr>                        <td align="right">                            性别:                        </td>                        <td>                            <input type="radio" name="sex" value="0" checked />                            男                            <input type="radio" name="sex" value="1" />                            女                        </td>                    </tr>                    <tr>                        <td align="right">                            电子邮箱:                        </td>                        <td>                            <s:textfield name="email"></s:textfield>                        </td>                        <td>                            <font color="red" align="left"><h6>                                    *必填                                </h6> </font>                        </td>                    </tr>                    <tr>                        <td align="right">                            验证码:                        </td>                        <td>                            <s:textfield name="validate"></s:textfield>                        </td>                        <td>                        [color=#FF0000]<img src="imageAction" align="left" alt="点击图片"                                onClick="shuaxin(this)" />[/color]                        </td>                    </tr>                    <tr>                        <td>                        </td>                        <td>                            <s:submit value="提交"></s:submit>                            <s:reset value="重置"></s:reset>                        </td>                    </tr>                </table>            </s:form>        </div>    </body></html>
  相关解决方案