jsp 表单提交失败。鼠标点击submit 页面不跳转,数据库也没有反应,根本不跳到register.jsp的页面去。
<formmethod="post"action="register.jsp"id="msform"><!--progressbar--><ulid="progressb...
<form method="post"action="register.jsp" id="msform">
<!-- progressbar -->
<ul id="progressbar">
<li class="active">填写用户名</li>
<li>设置您的密码</li>
<li>一些个性问题</li>
</ul>
<!-- fieldsets -->
<div id=check>
<fieldset>
<h2 class="fs-title">想一个奇妙的名字吧</h2>
<h3 class="fs-subtitle">This is step 1</h3>
<input type="text" name="usernames" placeholder="UserName"/>
<input type="button" name="next" class="next action-button" value="Next" />
</fieldset>
<fieldset>
<h2 class="fs-title">设置您的密码</h2>
<h3 class="fs-subtitle">This is step 2</h3>
<input type="password" name="passwords" placeholder="Password" />
<input type="password" name="repeatpasswords" placeholder="Repeat Password" />
<input type="button" name="previous" class="previous action-button" value="Previous" />
<input type="button" name="next" class="next action-button" value="Next" />
</fieldset>
<fieldset>
<h2 class="fs-title">一些细节问题</h2>
<h3 class="fs-subtitle">This is step 3</h3>
<input type="text" name="emails" placeholder="Email" />
<input type="text" name="phones" placeholder="Phone" />
<textarea name="addresses" placeholder="Address"></textarea>
<input type="button" name="previous" class="previous action-button" value="Previous" />
<input type="submit" name="qqq" class="submit action-button" value="Submit" />
</fieldset>
</div>
</form> 展开
<!-- progressbar -->
<ul id="progressbar">
<li class="active">填写用户名</li>
<li>设置您的密码</li>
<li>一些个性问题</li>
</ul>
<!-- fieldsets -->
<div id=check>
<fieldset>
<h2 class="fs-title">想一个奇妙的名字吧</h2>
<h3 class="fs-subtitle">This is step 1</h3>
<input type="text" name="usernames" placeholder="UserName"/>
<input type="button" name="next" class="next action-button" value="Next" />
</fieldset>
<fieldset>
<h2 class="fs-title">设置您的密码</h2>
<h3 class="fs-subtitle">This is step 2</h3>
<input type="password" name="passwords" placeholder="Password" />
<input type="password" name="repeatpasswords" placeholder="Repeat Password" />
<input type="button" name="previous" class="previous action-button" value="Previous" />
<input type="button" name="next" class="next action-button" value="Next" />
</fieldset>
<fieldset>
<h2 class="fs-title">一些细节问题</h2>
<h3 class="fs-subtitle">This is step 3</h3>
<input type="text" name="emails" placeholder="Email" />
<input type="text" name="phones" placeholder="Phone" />
<textarea name="addresses" placeholder="Address"></textarea>
<input type="button" name="previous" class="previous action-button" value="Previous" />
<input type="submit" name="qqq" class="submit action-button" value="Submit" />
</fieldset>
</div>
</form> 展开
展开全部
你应该没有很好地理解你学的东西,action=“”,里面填写的并不是你要跳转的页面,而是你要处理这个JSP的Action,你使用servlet还是struts2框架写的项目?
如果是struts2 ,则需要在struts.xml中进行配置
举例如下:此时假设你的 Action="register" class 是你处理register页面信息的java类
在struts.xml中的配置如下:
<action name="register" class="action.AddUserAction">
<result name="add-ok" type="redirectAction">
/register.jsp
</result>
<result name="add-error" >
/index.jsp
</result>
</action>
如果是struts2 ,则需要在struts.xml中进行配置
举例如下:此时假设你的 Action="register" class 是你处理register页面信息的java类
在struts.xml中的配置如下:
<action name="register" class="action.AddUserAction">
<result name="add-ok" type="redirectAction">
/register.jsp
</result>
<result name="add-error" >
/index.jsp
</result>
</action>
更多追问追答
追问
只是单纯的jsp 什么框架都还没用 注册表单填写完就想跳转到register.jsp页面进行数据库的连接等等。。。
追答
也没有servlet吗?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询