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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manuvering from one JSP/HTML page to another

Status
Not open for further replies.

Aman

Programmer
Feb 7, 2001
2
US
Hi all...the following bit of code has been causing me immense grief and I would be very grateful for any assistance I can get with this. Im basically trying to go back to a page called rfqTestsender after the code below remove an unwanted record from the db. After executing the code, I thought that because it went into the html form, it would read that on the load event, it should go to the javascript function "submitter" which should send the output back to the rfqTestsender page. All I get when I come to this page is a blan screen, even though it does remove the unwanted item from the db. If anyone can help I would be most grateful!

Ashraf

*****************CODE BEGINS****************************

<%@ page import=&quot;java.sql.*,
java.net.URLEncoder,
java.net.URLDecoder,
java.text.DecimalFormat,
java.util.*&quot;%>

<html>
<head>
<script language=&quot;javascript&quot;>
function submitter(daform){
alert(&quot;HELLO!&quot;);
daform.submit();
}
</script>
</head>
<body>
<%
String avRFQ_NUMBER = request.getParameter(&quot;RFQ_NUMBER&quot;);
System.out.println(avRFQ_NUMBER);
String remove = request.getParameter(&quot;REMOVE&quot;);
String avRFQ_LINE = request.getParameter(&quot;RFQ_LINE&quot;);

System.out.println(avRFQ_LINE);

String avTEAM = request.getParameter(&quot;TEAM&quot;);

System.out.println(avTEAM);

String avSTARTDATE = request.getParameter(&quot;STARTDATE&quot;);
String avCODE = request.getParameter(&quot;PLANT_CODE&quot;);
String avREQUESTOR = request.getParameter(&quot;REQUESTOR&quot;);
String avAUTHORIZED = request.getParameter(&quot;AUTHBUYER&quot;);

System.out.println(avSTARTDATE);

String avFAX_NUMBER = request.getParameter(&quot;FAX&quot;);
String avPHONE = request.getParameter(&quot;PHONE&quot;);
String avADDRESS = request.getParameter(&quot;ADDRESS&quot;);
String avQTY = request.getParameter(&quot;QTY&quot;);
String avCUST_RFQ = request.getParameter(&quot;CUST_RFQ&quot;);

String avEMAIL = request.getParameter(&quot;&quot;);
String avNAME = request.getParameter(&quot;PLANT_NAME&quot;);
String avGEDESC = request.getParameter(&quot;GEDESC&quot;);
String avCUSTDESC = request.getParameter(&quot;CUSTDESC&quot;);
String avPURCHASEOPTION = request.getParameter(&quot;PRICETYPE&quot;);
String avLEADTIME = request.getParameter(&quot;LEADTIME&quot;);

String avPRIORITY = request.getParameter(&quot;PRIORITY&quot;);
String avREQUESTDATE = request.getParameter(&quot;REQDATE&quot;);
String avSAFETYCLASS = request.getParameter(&quot;SAFETY&quot;);
String avOPTION = request.getParameter(&quot;OPTION&quot;);

Connection conn = null;
Statement stmt3; //= null;
Statement stmt4;
int rsRemove;
int rsInsert;

try
{
Class.forName(&quot;weblogic.jdbc.oci.Driver&quot;).newInstance();
}
catch(Exception e)
{
System.out.println(&quot;problem with the JDBC driver: &quot; + e);
}

try
{
conn = DriverManager.getConnection(&quot;jdbc:weblogic:eek:racle:engdev&quot;, &quot;GE156MAC&quot;, &quot;comet&quot;);


String SQLremove = &quot;delete from eng.comtcustrfq where RFQ_NUMBER=&quot; + avRFQ_NUMBER +
&quot; AND RFQ_LINE=&quot; + remove;
stmt3 = conn.createStatement();
rsRemove = stmt3.executeUpdate(SQLremove);
stmt3.close();

//response.sendRedirect(&quot;rfqsendTester.jsp?Del=true&quot;);

}
catch(SQLException e)
{
System.out.println(&quot;<hr>An error occurred: &quot; + e);
}

finally
{
try
{
conn.close();

}
catch(SQLException e)
{
System.out.println(&quot;<hr>An error occurred: &quot; + e);
}

} // end finally





%>

<form name=&quot;delete&quot; method=&quot;post&quot; action=&quot;rfqSendTester.jsp&quot; onLoad=&quot;javascript:submitter(document.delete)&quot;>
<input type=&quot;hidden&quot; name=&quot;RFQ_NUMBER&quot; value=&quot;<%= avRFQ_NUMBER %>&quot;>
<input type=&quot;hidden&quot; name=&quot;RFQ_LINE&quot; value=&quot;<%= avRFQ_LINE %>&quot;>
<input type=&quot;hidden&quot; name=&quot;TEAM&quot; value=&quot;<%= avTEAM %>&quot;>
<input type=&quot;hidden&quot; name=&quot;PLANT_NAME&quot; value=&quot;<%= avNAME %>&quot;>
<input type=&quot;hidden&quot; name=&quot;PLANT_CODE&quot; value=&quot;<%= avCODE %>&quot;>
<input type=&quot;hidden&quot; name=&quot;REQUESTOR&quot; value=&quot;<%= avREQUESTOR %>&quot;>
<input type=&quot;hidden&quot; name=&quot;AUTHBUYER&quot; value=&quot;<%= avAUTHORIZED %>&quot;>
<input type=&quot;hidden&quot; name=&quot;STARTDATE&quot; value=&quot;<%= avSTARTDATE%>&quot;>
<input type=&quot;hidden&quot; name=&quot;FAX&quot; value=&quot;<%= avFAX_NUMBER%>&quot;>
<input type=&quot;hidden&quot; name=&quot;PHONE&quot; value=&quot;<%= avPHONE%>&quot;>
<input type=&quot;hidden&quot; name=&quot;AUTHBUYER&quot; value=&quot;<%= avAUTHORIZED %>&quot;>
<input type=&quot;hidden&quot; name=&quot;ADDRESS&quot; value=&quot;<%= avADDRESS%>&quot;>
<input type=&quot;hidden&quot; name=&quot;QTY&quot; value=&quot;<%= avQTY%>&quot;>
<input type=&quot;hidden&quot; name=&quot;CUST_RFQ&quot; value=&quot;<%= avCUST_RFQ%>&quot;>
<input type=&quot;hidden&quot; name=&quot;EMAIL&quot; value=&quot;<%= avEMAIL%>&quot;>
<input type=&quot;hidden&quot; name=&quot;AUTHBUYER&quot; value=&quot;<%= avAUTHORIZED %>&quot;>
<input type=&quot;hidden&quot; name=&quot;GEDESC&quot; value=&quot;<%= avGEDESC%>&quot;>
<input type=&quot;hidden&quot; name=&quot;CUSTDESC&quot; value=&quot;<%= avCUSTDESC%>&quot;>
<input type=&quot;hidden&quot; name=&quot;PRICETYPE&quot; value=&quot;<%= avPURCHASEOPTION%>&quot;>
<input type=&quot;hidden&quot; name=&quot;LEADTIME&quot; value=&quot;<%= avLEADTIME%>&quot;>
<input type=&quot;hidden&quot; name=&quot;PRIORITY&quot; value=&quot;<%= avPRIORITY%>&quot;>
<input type=&quot;hidden&quot; name=&quot;REQDATE&quot; value=&quot;<%= avREQUESTDATE%>&quot;>
<input type=&quot;hidden&quot; name=&quot;SAFETY&quot; value=&quot;<%= avSAFETYCLASS%>&quot;>
<input type=&quot;hidden&quot; name=&quot;OPTION&quot; value=&quot;<%= avOPTION%>&quot;>

</body>
</html>
<%
System.out.println(&quot;Whats up?&quot;);
//response.sendRedirect(&quot;rfqsendTester.jsp?Del=true&quot;);
%>

********************CODE ENDS******************************
 
You have no visible html within your <body></body> tags. If you view source you will see all of your hidden inputs. &quot;What's up&quot; should be printing in your servlet engine/container. Change it from System.out.println to out.println and move it within the body tags and it will print to the html page.

Wushutwist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top