This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JSP and the fly likes please advise me on this Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "please advise me on this" Watch "please advise me on this" New topic

please advise me on this

Prasenjit Das

Joined: Aug 12, 2003
Posts: 10
hi folks,
I really dont know why this is coming and what to do about this.
I have a jsp page..a simple registration form...on clicking the submit button, i am setting a hidden parameter in a js function and reloading the page....
in the body of the page i have given an if condition using the hidden paramter to upload the db table ...
if(request.getParameter("param")!=null && request.getParameter("param").equals("1"))
str_address = adjquotes(request.getParameter("txt_Address"));
str_city = adjquotes(request.getParameter("txt_City"));
str_state = adjquotes(request.getParameter("txt_State"));
int_zip = Integer.parseInt(request.getParameter("txt_Zip"));
str_country = adjquotes(request.getParameter("txt_Country"));
str_email = adjquotes(request.getParameter("txt_Email"));
//construct the insert statement
str_insert="insert into tr_registration(first_name,middle_name,last_name,age,address,city,state,zip,country,reg_dt,email) values('"+str_FirstName+"','"+str_MiddleName+"','"+str_LastName+"','"+int_age+"','"+str_address+"','"+str_city+"','"+str_state+"',"+int_zip+",'"+str_country+"',to_char(sysdate,'dd/mm/yyyy'),'"+str_email+"')";
<script language="javascript:alert('Congratulations!!! You have been successfully registered');"/>
System.out.println("After the sendRedirect");
<script language="javascript"> alert("Sorry there was a problem with the registration, Please try again");</script>
// mail.send(str_email);


Now i am facing 2 problems
i) those javascript alerts are not coming. is there something wrong there?
ii) when i do a response.sendRedirect to that home.jsp; the page is opening fine, but even after the page has opened in the status bar i am getting...
opening home.jsp.....
PLzz help ....
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
this is not right:
<script language="javascript:alert('Congratulations!!! You have been successfully registered');"/>
code it like the other one!
I agree. Here's the link:
subject: please advise me on this
jQuery in Action, 3rd edition