Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JSP page is submitting wrong data!

Status
Not open for further replies.

dendenners

Programmer
Jul 17, 2001
110
IE
Hey guys,
I have a problem with a jsp page (using weblogic). On this page I have a few text fields. I also have a submit button which uses javascript to set a command which is sent back to the servlet for processing every time the button is pressed. However, when someone presses return while focussed on one of the text fields on the page, the form is submitted to the servlet with a blank command! This is not the case on most of my jsps, just a couple, but I can't for the life of me see the difference between those that work and those that do not. Has anyone encountered this problem before and are there any solutions? Thank you
 
insted using the submit button use input type= button and onclick of that button do the document.formname.submit()

Regards
enjoy2001
 
help me:
When I deploy my jsp in Weblogic 6.1,it doesn't work.Because I compare a string to a Chinese string.the scriptlet is as follows:
<html>
<body>
<%
request.setCharacterEncoding(&quot;GB2312&quot;);
String strLoginType=&quot;111&quot;;
String tt=&quot;333²Ý&quot;;
if (strLoginType==null|| strLoginType.compareTo(tt)!=0) {

// response.sendRedirect(&quot;/health/session_error.jsp&quot;);
out.println(&quot;no session&quot;);
int XXXXXXXXXX = 0;
}

%>
</body>
</html>

but when I change the above like this :
<html>
<body>
<%
request.setCharacterEncoding(&quot;GB2312&quot;);
String strLoginType=&quot;111&quot;;
String tt=&quot;333²Ý&quot;;
if (strLoginType==null|| strLoginType.compareTo(tt)!=0) {%>
<%
// response.sendRedirect(&quot;/health/session_error.jsp&quot;);
out.println(&quot;no session&quot;);
int XXXXXXXXXX = 0;
}

%>
</body>
</html>
It does function .but there are many places like this in my jsp pages,how can I make these pages work without change them like above from one to one
thanks !!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top