• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with buttons action in jsp page

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a jsp page on struts-based web application. With this jsp page, buttons work perfectly in IE and Netscape7.0, but these buttons(add and save)do not work at all in Netscape4.7. The redirect action does not work. Could anyone give me some suggestion and comments? Appreciated a lot.
<%-- code start --%>
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<title>Test</title>
</head>
<script language="Javascript">
function submitPage(button){
if (button=='add') {
document.forms[0].action = "../jsp/page1.do?task=add";
document.forms[0].submit();
}
if (button=='save') {
document.forms[0].action = "../jsp/page1.do?task=save";
document.forms[0].submit();
}
}
</script>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<html:form action="/jsp/test.do?task=get" name="testForm" type="formbeans.TestForm" scope="session">
<tr>
<td colspan="4"> </td>
</tr>
</html:form>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="3">
<%--THE ADD BUTTON--%>
<html:link href="javascript:submitPage('add')"><html:img srcKey="imgRecSetNav.btnAdd.src" border="0"/></html:link>
<%--THE SAVE BUTTON--%>
<html:link href="javascript:submitPage('save')"><html:img srcKey="imgModFunct.btnSave.src" border="0"/></html:link>
</td>
<td width="19%"> </td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
</table>
</body>
</html>
<%-- code end --%>
Thanks again,
Nora
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Despite appearing within a JSP page, this is clearly an HTML/Javascript question and I'll move this topic along to that forum.
bear
 
Nora Green
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bear for moving the question here. I am just searching help everywhere. First I posted on struts forum, but one one response yet. It seems a struts action problem, that formbean not submitted in NetScape 4.7. And there is no error message. It works well in IE and Netscape7.0. Thanks,
Nora
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a quick glance, not 100% positive, but your buttons are outside your fowm, Netscape 4 might have problems with that. Try to move the form tags to encompass the whole body. aka. place open form tag under body tag and closed form tag over the closed body tag.
Netscape 4.X is picky about format stuff....
 
Nora Green
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Eric for the suggestion. I replaced the tag <html:form> </html:form> just below the <body> layer. It is the same result as before.
 
Nora Green
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem was solved! It is because the formbean is empty which has no property inside. We keep the empty formbean to make structure consistent. The Netscape4.7 does not like the empty formbean, then stopping submit the form. Just let you know the result in case you have interested in it.
Nora.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic