struts中怎么用普通的button按钮 用js + html 就可以了. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 只能用javascript吗?struts肯定提供这样的功能的。 <html:button property="这里可以不用添啊~这是你对应的formbean的属性" value="" onclick="页面" />没问题啊~~~` 不行啊,property不写的话,它出错,说这个属性是必须的。写上了,点击还是没反应啊?我的代码如下:<form>.....</form><html:button property="" value="register" onclick="/RegAction.do"/>把上面这句写在form里也没用。 <html:button property="定义在表单被提交时返回到服务器的请求参数的名称" value="register" onclick="javascript:window.submit()">Struts功能暂时就提供到这,表单提交还要用javascript. 也就是说:<html:button property="reg" value="register" onclick="javascript:window.submit()">提交到的页面可以这样用 : String reg = request.getParameter("reg");if ("register".equals(reg)) {提交后要做的动作!} 可我在表单中并没有对应该button的属性啊(也不需要),我只要实现简单的转页功能.你的写法似乎要来个中间页面来处理。好像记得是用document的,js不熟啊!帮我写一下吧:) 我现在这样写:<html:button property="" value="register" onclick="window.open('regEdit.do')"/>是可以了,可它打开了新窗口。我让它在原窗口打开。怎么办。window好像有个self熟行,可怎么用啊 如果你不是要把你的表单提交到另一个页面是可以的,你说的就是要提交到本页面,还是在本页打开另一页?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> 关于MD5的问题 struts1.3里有没有页面嵌套的标签?该如何用呢? session提交后事务还执行吗? 这样的逻辑怎么实现比较好: 如何得到当前程序运行的路径 急!页面大数组传递的问题 谁知道这个程序的结果? 中文无法正常显示,哪位好心的神仙帮个忙啊?? jsp list分页 出错!急求解决!应该是很简单的问题吧! 小问题,挣分的好机会 高手帮忙,为什么不用NEW????
onclick="页面" />
没问题啊~~~`
.....
</form>
<html:button property="" value="register" onclick="/RegAction.do"/>把上面这句写在form里也没用。
Struts功能暂时就提供到这,表单提交还要用javascript.
String reg = request.getParameter("reg");
if ("register".equals(reg)) {
提交后要做的动作!
}
你的写法似乎要来个中间页面来处理。好像记得是用document的,js不熟啊!帮我写一下吧:)
<html:button property="" value="register" onclick="window.open('regEdit.do')"/>
是可以了,可它打开了新窗口。我让它在原窗口打开。怎么办。window好像有个self熟行,可怎么用啊
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>