jsp

jsp

<p>hai sir,
   i have to send the data which i have in hrid table to data base and at the same time to the next form . i will give  u the code.</p>

<p>first form(project Manager.jsp)
&lt;%@ page language = "java" import = "java.sql.<em>" import = "java.util.</em>" import = "java.io.*" errorPage = "" %>
<jsp:useBean id = "formHandler" class = "testing.Beanform" scope = "request"/></p>

<p><html>
<head></p>

<script src = "js/client_validation.js" type = 'text/javascript'></script>
<script language = "javascript" type = "text/javascript">
        function Mandatory_Checking()
        {
            effectivedate = TXTBOX_Mandatory(document.forms[0].effectivedate,"EffectiveDate");
            if(effectivedate == false)
                return false;   
            expirydate = TXTBOX_Mandatory(document.forms[0].expirydate,"Expiry Date");
            if(expirydate == false)
                return false;
        }
        function setfocus()
        {
            document.getElementById("effectivedate").focus();
        }
    </script>
    <script language = "javascript">   
    function addRows(tbl_actionrequired) 
    {
        var table = document.getElementById(tbl_actionrequired);
        var rowCount = table.rows.length;
        var row = table.insertRow(rowCount);
        var first_cell = row.insertCell(0);
        var element1 = document.createElement("input");
        element1.type = "checkbox";
        first_cell.appendChild(element1);


        var second_cell = row.insertCell(1);
        second_cell.innerHTML = document.getElementById("txt_milestone").value;


        var third_cell = row.insertCell(2);
        third_cell.innerHTML = document.getElementById("txt_milestoneduedate").value;


    }
    function deleteRows(tbl_actionrequired) 
    {
        try 
        {
            var table = document.getElementById(tbl_actionrequired);
            var rowCount = table.rows.length;
            for(var i=0; i<rowCount; i++) 
            { 
                var row = table.rows[i];
                var chkbox = row.cells[0].childNodes[0];
                if(null != chkbox && true == chkbox.checked) 
                {
                    table.deleteRow(i);
                    rowCount--;
                    i--;
                }
            }  
        }
        catch(e) 
        {  
            alert(e); 
        }
    } 


    //Script for the Capture Penalities table
function P_addrow(capture_penalites)
{


    var table = document.getElementById(capture_penalites);

    var rowCount = table.rows.length;
    var row = table.insertRow(rowCount);
    var first_cell= row.insertCell(0);
    var element1 = document.createElement("input");
    element1.type="checkbox";
    first_cell.appendChild(element1);



        var second_cell = row.insertCell(1);
        second_cell.innerHTML = document.getElementById("txt_penality").value;



}
function P_deleterow(capture_penalites) 
    {
        try 
        {
            var table = document.getElementById(capture_penalites);
            var rowCount = table.rows.length;
            for(var i=0; i<rowCount; i++) 
            { 
                var row = table.rows[i];
                var chkbox = row.cells[0].childNodes[0];
                if(null != chkbox && true == chkbox.checked) 
                {
                    table.deleteRow(i);
                    rowCount--;
                    i--;
                }
            }  
        }
        catch(e) 
        {  
            alert(e); 
        }
    } 
    //script for the reporting table

function R_addrows(reporting)
{


    var table = document.getElementById(reporting);

    var rowCount = table.rows.length;
    var row = table.insertRow(rowCount);
    var first_cell= row.insertCell(0);
    var element1 = document.createElement("input");
    element1.type="checkbox";
    first_cell.appendChild(element1);



        var second_cell = row.insertCell(1);
        second_cell.innerHTML = document.getElementById("txt_report").value;

        var third_cell = row.insertCell(2);
        third_cell.innerHTML = document.getElementById("txt_reportingduedate").value;



}
function R_deleterows(reporting) 
    {
        try 
        {
            var table = document.getElementById(reporting);
            var rowCount = table.rows.length;
            for(var i=0; i<rowCount; i++) 
            { 
                var row = table.rows[i];
                var chkbox = row.cells[0].childNodes[0];
                if(null != chkbox && true == chkbox.checked) 
                {
                    table.deleteRow(i);
                    rowCount--;
                    i--;
                }
            }  
        }
        catch(e) 
        {  
            alert(e); 
        }
    }
//script for gird table
    var cont_curdate;
    function makeArray()
    {
        //Start Current Date processing
        for (i = 0; i<makeArray.arguments.length; i++)
        this[i + 1] = makeArray.arguments[i];
        //End Current Date processing
    }

//var months = new makeArray('January','February','March','April','May',
//'June','July','August','September','October','November','December');

    var months = new makeArray('01','02','03','04','05','06','07','08','08','10','11','12');
    var date = new Date();
    var day = date.getDate();
    var month = date.getMonth() + 1;
    var yy = date.getYear();
    var year = (yy < 1000) ? yy + 1900 : yy;
//End Current Date Processing

    cont_curdate=year +  months[month] +  day;
    function addRow(tableID) 
    {
        var table = document.getElementById(tableID);
        var rowCount = table.rows.length;
        var row = table.insertRow(rowCount);

        var cell1 = row.insertCell(0);
        cell1.innerHTML =document.getElementById("txt_browse").value;

        var cell2 = row.insertCell(1);
        cell2.innerHTML=document.getElementById("txt_data").value;

        var cell2 = row.insertCell(2);
        //VAR CONT_CURDATE=YEAR +  MONTHS[MONTH] +  DAY;
        cell2.innerHTML=cont_curdate;           
    }   
    function deleteRow(tableID)
{
  //get the table
  var table = document.getElementById(tableID);

  //delete the last row
  if(table.rows.length > 1)
    table.deleteRow(table.rows.length - 1);
}

</script>

<pre class="prettyprint">&lt;body&gt;
&lt;form  id="registrationadd" name="registrationadd" action = "processing.jsp" method="post"&gt; 
&lt;table width = "60%" border = "0" cellpadding = "0" cellspacing = "0" bgcolor = "#fee5cb" align = "center"&gt;
    &lt;img src = "01.jpg" align = "center"&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;table width = "100%" border = 0 align = "center" cellpadding = "5" cellspacing = "0"&gt;
                &lt;tr align = "left" valign = "middle"&gt;&lt;/tr&gt;
                &lt;td bgcolor = "#fee5cb" colspan = 2&gt;
                    &lt;h3&gt;ProjectManager:Output Details&lt;/h3&gt;
                    &lt;font size = 3 color = "red"&gt;&lt;sup&gt;*&lt;/sup&gt; Required Fields&lt;/font&gt;
                &lt;/td&gt;
            &lt;/table&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;fieldset&gt;
                    &lt;legend&gt;&lt;img src="./image/Contract Dates.png" border="0" width="16" height="16" alt="Contract Dates"align="absmiddle"&gt;&amp;nbsp;Contract Dates&lt;/legend&gt;&lt;table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%"&gt;&lt;/legend&gt;
                    &lt;table width = "100%" height = "120" border = "0" cellpadding = "0" cellspacing = "0" rules = "rows"&gt;
                    &lt;tr&gt;
                            &lt;td width="40%" valign="middle" align="left"&gt;Effective Date:&lt;/td&gt;
                            &lt;td align="left" valign="middle"&gt;&lt;input type="text" name="effectivedate" value="" size="35"&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                            &lt;td width ="40%" valign="middle" align="left"&gt;Exipry Date:&lt;/td&gt;
                            &lt;td align ="left" valign="middle"&gt;&lt;input type="text" name="expirydate" value="" size="35"&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                            &lt;td width="40%" valign="middle" align="left"&gt;Duration:&lt;/td&gt;
                            &lt;td align ="left" valign="middle"&gt;&lt;input type="text" name="duration" value="" size="35"&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                            &lt;td width="40%" valign="middle" align="left"&gt;Last Signature Date:&lt;/td&gt;
                            &lt;td align ="left" valign="middle" &gt;&lt;input type="text" name="lastsignature" value="" size="35"&gt;
                            &lt;img class = "PopcalTrigger" align = "absmiddle" src = "Datepickerfiles/calendar.gif" width = "20" height = "20" border = "0" alt = "Click to show calendar" onClick = "if(self.gfPop)gfPop.fPopCalendar(document.registrationadd.lastsignature);return false;" style = "cursor:hand" /&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;/table&gt;
                &lt;/fieldset&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;fieldset&gt;
            &lt;legend&gt;&lt;img src="./image/Purpose of Contract.png" border="0" width="16" height="16" alt="Contract Review" align="absmiddle"&gt;&amp;nbsp;Contract Review&lt;/legend&gt;
            &lt;table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%"&gt;
            &lt;tr&gt;
                &lt;td width="40%" valign="middle" align="left"&gt;Review Term Year:&lt;/td&gt;
                &lt;td align="left" valign="middle"&gt;&lt;input type="text" name="reviewtermyear" value="" size="35"&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td width="40%" valign="middle" align="left"&gt;Review Term Months:&lt;/td&gt;
                &lt;td align="left" valign="middle"&gt;&lt;input type="text" name="reviewtermmonth" value="" size="35"&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;/table&gt;
            &lt;/fieldset&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;fieldset&gt;
            &lt;legend&gt;&lt;img src="./image/Milestone.png"border="0" width="16"height="16"alt="Milestone"
                   align="absmiddle"&gt;&amp;nbsp;Milestone&lt;/legend&gt;
                   &lt;table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%"&gt;
                   &lt;tr&gt;
                      &lt;td class="GeneralText" name="Purpose of Contract" size="20"&gt;&lt;/td&gt;
                   &lt;/tr&gt;
                   &lt;tr&gt;
                        &lt;td width=40% valign="middle"align="left"&gt;Milestone:&lt;/td&gt;
                        &lt;td align="left" valign="middle"&gt;&lt;input type="text"name="milestone" id="txt_milestone"value="" size="35"&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td width ="40%" valign="middle" align="left"&gt;MileStoneDueDate:&lt;/td&gt;
                        &lt;td align ="left" valign="middle"&gt;&lt;input type ="text"name="milestoneduedate"id="txt_milestoneduedate"value="" size="35"&gt;
                        &lt;img class = "PopcalTrigger" align = "absmiddle" src = "Datepickerfiles/calendar.gif" width = "20" height = "20" border = "0" alt = "Click to show calendar" onClick = "if(self.gfPop)gfPop.fPopCalendar(document.registrationadd.milestoneduedate);return false;" style = "cursor:hand" /&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;/table&gt;

                    &lt;input type = "button" value = "Add Rows" onClick = "addRows('action_duedate')" /&gt;
                    &lt;input type="button" value="Delete Rows" onClick ="deleteRows('action_duedate')"/&gt;
                         &lt;table id = "action_duedate" width = "595" border = "1"&gt; 
                           &lt;th width = "57"&gt;Select&lt;/th&gt;
                           &lt;th width = "57"&gt;Milestone &lt;/th&gt;
                           &lt;th width = "341"&gt;MilestonedueDate&lt;/th&gt;

                      &lt;/table&gt; 

            &lt;/fieldset&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;fieldset&gt;
                     &lt;legend&gt;&lt;img src="./image/Contract Amount.png" border="0" width="16" height="16" alt="Payment"&gt;&amp;nbsp;Payment&lt;/legend&gt;

                      &lt;table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%"&gt;

                    &lt;tr&gt;
                        &lt;td width="40%" valign="middle" align="left"&gt;Payment Due Date:&lt;/td&gt;
                        &lt;td align="left" valign="middle"&gt;&lt;input type="text" name="paymentduedate" value="" size= "35"&gt;
                        &lt;img class="PopcalTrigger" align="absmiddle" src="Datepickerfiles/calendar.gif" width="20" height="20" border="0" alt="Click to show calendar" onClick="if(self.gfPop)gfPop.fPopCalendar(document.registrationadd.paymentduedate);return false;" style="cursor:hand" /&gt;
                        &lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/table&gt;

            &lt;/fieldset&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;fieldset&gt;
                &lt;legend&gt;&lt;img src="./image/Purpose of Contract.png" border="0" width="16" height="16" alt="Penalites" align="absmiddle"&gt;&amp;nbsp;Penalites&lt;/legend&gt;
                &lt;table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%"&gt;
                &lt;tr&gt;
                    &lt;td width="40%" valign="middle" align="left"&gt;Capture Penalites:&lt;/td&gt;
                    &lt;td align="left" valign="middle"&gt;&lt;input type="text" name="capturepenalites"id="txt_penality" value=""size="35"&gt;&lt;/td&gt;
                &lt;/tr&gt;
                &lt;/table&gt;
                &lt;input type = "button" value = "Add Rows" onClick = "P_addrow('capture_penalites')" /&gt;
                &lt;input type="button" value="Delete Rows" onClick = "P_deleterow('capture_penalites')"/&gt;
                         &lt;table id = "capture_penalites" width = "595px" border = "1"&gt;
                            &lt;th width ="57"&gt;Select&lt;/th&gt;
                           &lt;th width = "57" align="center"&gt;Penalites&lt;/th&gt;        


                &lt;/table&gt;
            &lt;/fieldset&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;fieldset&gt;&lt;legend&gt;&lt;img src ="./image/Purpose of Contract.png" border="0" width = "16" height="16" alt="Remainder for Reporting" align="absmiddle"&gt;&amp;nbsp;Remainder For Reporting&lt;/legend&gt;
            &lt;table cellspacing ="0" cellpadding="0" rules="rows" border="0" width="100%"&gt; 
            &lt;tr&gt;
                &lt;td width="40%" valign="middle" align="left"&gt;Report:&lt;/td&gt;
                &lt;td align="left" valign="middle"&gt;&lt;input type="text" name="report"id="txt_report" value="" size="35"&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td width="40%" valign="middle" align="left" &gt;Reporting DueDate:&lt;/td&gt;
                &lt;td align="left" valign="middle"&gt;&lt;input type="text" name="reportingduedate" id="txt_reportingduedate"value="" size="35"&gt;
                &lt;img class="PopcalTrigger" align="absmiddle" src="Datepickerfiles/calendar.gif" width="20" height="20" border="0" alt="Click to show calendar" onClick="if(self.gfPop)gfPop.fPopCalendar(document.registrationadd.reportingduedate);return false;" style="cursor:hand" /&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;/table&gt;
                    &lt;input type = "button" value = "Add Rows" onClick = "R_addrows('reporting')" /&gt;
                    &lt;input type="button" value="Delete Rows" onClick = "R_deleterows('reporting')"/&gt;
                     &lt;table id = "reporting" width = "595px" border = "1"&gt;
                        &lt;th width ="57"&gt;Select&lt;/th&gt;
                        &lt;th width ="57"&gt;Report&lt;/th&gt;
                        &lt;th width="57"&gt;DueDate&lt;/th&gt;
                    &lt;/table&gt;                                       
            &lt;fieldset&gt;

        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;fieldset&gt;
                &lt;legend&gt;&lt;img src="./image/Contract Dates.png" border="0" width="16" height="16" alt="Signed Contract"align="absmiddle"&gt;&amp;nbsp;Signed Contract&lt;/legend&gt;
                &lt;table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%"&gt;&lt;/legend&gt;
                &lt;tr&gt;
                    &lt;td width="35%" align="left" valign="middle"&gt;Attach Signed Copy:&lt;/td&gt;
                    &lt;td align="left" valign="middle"&gt;&lt;input type="file" value="Browse"id="txt_browse" name="document"/&gt;&lt;input type="text" id="txt_data"name="datauploaded"&gt;
                    &lt;input type="button" value="Add Attachments" name="upload" onClick ="addRow('gridvalues')"/&gt;&lt;/td&gt;
                &lt;/tr&gt;
                &lt;/table&gt;
                &lt;table id = "gridvalues" width = "595px" border = "1"&gt;
                    &lt;th width ="135"&gt;Document Name&lt;/th&gt;
                    &lt;th width ="135"&gt;uploaded by&lt;/th&gt;
                    &lt;th width="135"&gt;Date of Upload&lt;/th&gt;
                &lt;/table&gt;
            &lt;/fieldset&gt;
        &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
        &lt;td align="right" valign="right"&gt;&lt;input type="button" value="Submit" onClick = "Mandatory_Checking();"/&gt;&lt;input type="submit" value="Save"/&gt;&lt;input type="submit" value="Cancel"/&gt;&lt;/td&gt;
    &lt;/tr&gt;

        &lt;iframe width = "174" height = "189" name = "gToday:normal:agenda.js" id = "gtoday:normal:agenda.js" src = "Datepickerfiles/ipopeng.htm" scrolling = "no" frameborder = "0" style = "visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;"&gt;&lt;/iframe&gt;
</code></pre>

<p></body>
</head>
</html></p>

<p>second form (projectmanagerform.jsp)</p>

<p>&lt;%@ page language = "java" import = "java.sql.<em>" import = "java.util.</em>" import = "java.io.*" errorPage = "" %>
<jsp:useBean id = "formHandler" class = "testing.Beanform" scope = "request"/></p>

<p><html>
<head>
&lt;%</p>

<p>  Class.forName("org.gjt.mm.mysql.Driver");
  System.out.println("Driver class is loaded...");
  System.out.println("Connection is established....");
  Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/contract","root","");</p>

<p>  PreparedStatement psInsertRecord=null;
  System.out.println("PreparedStatement object is created....");
  String sqlInsertRecord=null;</p>

<p>  //put the database field names here 
  String effectivedate = request.getParameter("effectivedate");
  String expirydate = request.getParameter("expirydate");
  String duration = request.getParameter("duration");
  String lastsignature = request.getParameter("lastsignature");
  String reviewtermyear = request.getParameter("reviewtermyear");
  String reviewtermmonth = request.getParameter("reviewtermmonth");
  String milestone = request.getParameter("milestone");
  String milestoneduedate = request.getParameter("milestoneduedate");
  String paymentduedate = request.getParameter("paymentduedate");
  String capturepenalites = request.getParameter("capturepenalites");
  String report = request.getParameter("report");
  String reportingduedate = request.getParameter("reportingduedate");
  String document = request.getParameter("document");
  String upload = request.getParameter("upload");
  String datauploaded = request.getParameter("datauploaded");</p>

<p>//set the String types variables here <br />
  try
  {
        sqlInsertRecord = "insert into tbl_projectmanager (effectivedate,expirydate,duration,lastsignature,reviewtermyear,reviewtermmonth,milestone,milestoneduedate,paymentduedate,capturepenalites,report,reportingduedate,document,upload,datauploaded)values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
        psInsertRecord = conn.prepareStatement(sqlInsertRecord);
        psInsertRecord.setString(1,effectivedate);
        psInsertRecord.setString(2,expirydate);
        psInsertRecord.setString(3,duration);
        psInsertRecord.setString(4,lastsignature);
        psInsertRecord.setString(5,reviewtermyear);
        psInsertRecord.setString(6,reviewtermmonth);
        psInsertRecord.setString(7,milestone);
        psInsertRecord.setString(8,milestoneduedate);
        psInsertRecord.setString(9,paymentduedate);
        psInsertRecord.setString(10,capturepenalites);
        psInsertRecord.setString(11,report);
        psInsertRecord.setString(12,reportingduedate);
        psInsertRecord.setString(13,document);
        psInsertRecord.setString(14,upload);
        psInsertRecord.setString(15,datauploaded);</p>

<pre class="prettyprint">    psInsertRecord.executeUpdate();

}
catch(Exception e)
{
    response.sendRedirect("projectmanagerform.jsp");//// On error it will send back to addRecord.jsp page
}

try
{
  if(psInsertRecord!=null)
  {

      psInsertRecord.close();
  }

  if(conn!=null)
  {
      conn.close();
  }
}
catch(Exception e)
{
    e.printStackTrace(); 
}
</code></pre>

<p>%>
<body></p>

<table width = "60%" border = "0" cellpadding = "0" cellspacing = "0" bgcolor = "#fee5cb" align = "center">
        <img src = "01.jpg" align = "center">
        <tr>
            <td>
                <table width = "100%" border = 0 align = "center" cellpadding = "5" cellspacing = "0">
                    <tr align = "left" valign = "middle"></tr>
                    <td bgcolor = "#fee5cb" colspan = 2>
                        <h3>ProjectManager:Output Details</h3>
                        <font size = "3" color = "red"><sup>*</sup> Required Fields</font>
                    </td>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <fieldset>
                        <legend><img src="./image/Contract Dates.png" border="0" width="16" height="16" alt="Contract Dates"align="absmiddle">&nbsp;Contract Dates</legend><table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%"></legend>
                        <table width = "100%" height = "120" border = "0" cellpadding = "0" cellspacing = "0" rules = "rows">
                        <tr>
                                <td width="40%" valign="middle" align="left">Effective Date:</td>
                                <td align="left" valign="middle"><jsp:getProperty name="formHandler" property="effectivedate"/></td>
                        </tr>
                        <tr>
                                <td width="40%" valign="middle" align="left">Expiry Date:</td>
                                <td align="left" valign="middle"><jsp:getProperty name="formHandler" property ="expirydate"/></td>
                        </tr>
                        <tr>
                                <td width="40%" valign="middle" align="left">Duration:</td>
                                <td align="left" valign="middle"><jsp:getProperty name="formHandler" property ="duration"/></td>
                        </tr>
                        <tr>
                                <td width="40%" valign="middle" align="left">Last Signature:</td>
                                <td align="left" valign="middle"><jsp:getProperty name="formHandler" property ="lastsignature"/></td>
                        </tr>
                        </table>
                </fieldset>
            </td>
        </tr>
        <tr>
            <td>
                <fieldset>
                <legend><img src="./image/Purpose of Contract.png" border="0" width="16" height="16" alt="Contract Review" align="absmiddle">&nbsp;Contract Review</legend>
                <table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%">
                <tr>
                    <td width="40%" valign="middle" align="left">Review Term Year:</td>
                    <td align="left" valign="middle"><jsp:getProperty name="formHandler" property="reviewtermyear"/></td>
                </tr>
                <tr>
                    <td width="40%" valign="middle" align="left" >Review Term Month:</td>
                    <td align="left" valign="middle"><jsp:getProperty name="formHandler" property ="reviewtermmonth"/></td>
                </tr>
                </table>
            </td>
        </tr>

        <tr>
            <td>
                <fieldset>
                <legend><img src="./image/Milestone.png"border="0" width="16"height="16"alt="Milestone"
                       align="absmiddle">&nbsp;Milestone</legend>
                       <table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%">
                       <tr>
                          <td class="GeneralText" name="Purpose of Contract" size="20"></td>
                       </tr>

                        </table>
                        <table id = "action_duedate" width = "595" border = "1"> 
                               <th width = "57">Select</th>
                               <th width = "57">Milestone </th>
                               <th width = "341">MilestonedueDate</th>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;<jsp:getProperty name="formHandler" property="milestone"/></td>
                                <td>&nbsp;<jsp:getProperty name="formHandler"property="milestoneduedate"/></td>
                            </tr>
                          </table>

                    </fieldset>
                </td>
            </tr>
            <tr>
                <td>
                    <fieldset>
                         <legend><img src="./image/Contract Amount.png" border="0" width="16" height="16" alt="Payment">&nbsp;Payment</legend>

                          <table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%">

                        <tr>
                            <td width="40%" valign="middle" align="left">Payment Due Date:</td>
                            <td align="left" valign="middle"><jsp:getProperty name="formHandler" property ="paymentduedate"/></td>
                        </tr>
                        </table>
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td>
                    <fieldset>
                        <legend><img src="./image/Purpose of Contract.png" border="0" width="16" height="16" alt="Penalites" align="absmiddle">&nbsp;Penalites</legend>
                    <table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%">

                    </table>
                         <table id = "capture_penalites" width = "595px" border = "1">
                                <th width ="57">Select</th>
                               <th width = "57" align="center">Penalites</th>
                             <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;<jsp:getProperty name="formHandler" property="capturepenalites"/></td>
                            </tr>


                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <fieldset><legend><img src="./image/Purpose of Contract.png" border="0" width="16" height="16" alt="Remainder for reporting" align="absmiddle">&nbsp;Remainder For Reporting </legend>
                    <table cellpadding="0" cellspacing ="0" rules="rows" border="0" width="100%">

                    </table>
                     <table id = "reporting" width = "595px" border = "1">
                    <th width ="57">Select</th>
                    <th width ="57">Report</th>
                    <th width="57">DueDate</th>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;<jsp:getProperty name="formHandler" property ="report"/></td>
                        <td>&nbsp;<jsp:getProperty name="formHandler" property ="reportingduedate"/></td>
                    </tr>

                </table>
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td>
                    <fieldset>
                        <legend><img src="./image/Contract Dates.png" border="0" width="16" height="16" alt="Signed Contract"align="absmiddle">&nbsp;Signed Contract</legend>
                        <table cellspacing="0" cellpadding="0" rules="rows" border="0" width="100%"></legend>
                        </table>
                        <table id = "gridvalues" width = "595px" border = "1">
                            <th width ="57">Document Name</th>
                            <th width ="57">uploaded by</th>
                            <th width="57">Date of Upload</th>
                            <tr>
                                <td>&nbsp;<jsp:getProperty name="formHandler" property ="document"/></td>
                                <td>&nbsp;<jsp:getProperty name="formHandler" property ="upload"/></td>
                                <td>&nbsp;<jsp:getProperty name="formHandler" property ="datauploaded"/></td>
                            </tr>
                        </table>
                    </fieldset>
                </td>
            </tr>


</body>
</table>

<pre class="prettyprint">    &lt;h3&gt;Records are inserted into Database Successfully..&lt;/h3&gt;
</code></pre>

<p></html></p>

<p>third form (processing.jsp)
&lt;%@ page language="java" %>
&lt;%@ page import="java.util.*" %>
&lt;%! </p>

<p>%>
<jsp:useBean id="formHandler" class="testing.Beanform" scope="request">
<jsp:setProperty name="formHandler" property="*"/>
</jsp:useBean>
&lt;% 
   if (formHandler.validate()) {
%>  <jsp:forward page="projectmanagerform.jsp"/></p>

<p>&lt;%
   }  else {
%>
    <jsp:forward page="ProjectManager.jsp"/>
&lt;%
   }
%>
next java bean form</p>

<p> package testing;</p>

<p>import java.io.*;
import java.util.*;</p>

<p>public class Beanform
{
    private String effectivedate;
    private String expirydate;
    private String duration;
    private String lastsignature;
    private String reviewtermyear;
    private String reviewtermmonth;
    private String milestone;
    private String milestoneduedate;
    private String paymentduedate;
    private String capturepenalites;
    private String report;
    private String reportingduedate;
    private String document;
    private String upload;
    private String datauploaded;</p>

<pre class="prettyprint">private Hashtable errors;

public  boolean validate()
{
    boolean bool=true;
    if(effectivedate.equals(""))
    {
        errors.put("effectivedate","please enter effectivedate");
        effectivedate="";
        bool=false;
    }
    if(expirydate.equals(""))
    {
        errors.put("expirydate","please enter exiprydate");
        expirydate="";
        bool=false;
    }
    if(duration.equals(""))
    {
        errors.put("duration","please enter duration");
        duration="";
        bool=false;
    }
    if(lastsignature.equals(""))
    {
        errors.put("lastsignature","please enter lastsignature");
        lastsignature = "";
        bool=false;
    }
    if(reviewtermyear.equals(""))
    {
        errors.put("reviewtermyear","please enter reviewtermyear");
        reviewtermyear = "";
        bool= false;
    }
    if(reviewtermmonth.equals(""))
    {
        errors.put("reviewtermmonth","please enter reviewtermmonth");
        reviewtermmonth = "";
        bool = false;
    }
    if(milestone.equals(""))
    {
        errors.put("milestone","please enter milestone");
        milestone="";
        bool = false;
    }
    if(milestoneduedate.equals(""))
    {
        errors.put("milestoneduedate","please enter milestoneduedate");
        milestoneduedate="";
        bool = false;
    }
    if(paymentduedate.equals(""))
    {
        errors.put("paymentduedate","please enter paymentduedate");
        paymentduedate="";
        bool=false;
    }
    if(capturepenalites.equals(""))
    {
        errors.put("capturepenalites","please enter capturepenalites");
        capturepenalites="";
        bool=false;
    }
    if(report.equals(""))
    {
        errors.put("report","please enter report");
        report = "";
        bool=false;
    }
    if(reportingduedate.equals(""))
    {
        errors.put("reportingduedate","please enter reportingduedate");
        reportingduedate="";
        bool=false;
    }
    if(document.equals(""))
    {
        errors.put("document","please enter document");
        document ="";
        bool=false;
    }
    if(upload.equals(""))
    {
        errors.put("upload","please enter upload");
        upload="";
        bool=false;
    }
    if(datauploaded.equals(""))
    {
        errors.put("datauploaded","please enter datauploaded");
        datauploaded="";
        bool=false;
    }

 return  bool;
</code></pre>

<p>}
    public  String getErrorMsg(String s) 
    {
        String errorMsg =(String)errors.get(s.trim());
        return (errorMsg == null) ? "":errorMsg;
    }
    public  Beanform()
    {
        effectivedate="";
        expirydate="";
        duration="";
        lastsignature = "";
        reviewtermyear="";
        reviewtermmonth = "";
        milestone="";
        milestoneduedate="";
        paymentduedate="";
        capturepenalites="";
        report="";
        reportingduedate="";
        document="";
        upload="";
        datauploaded="";</p>

<pre class="prettyprint">errors= new Hashtable();
}
 public String getEffectivedate()
{
     return effectivedate;
}
public  String getExpirydate()
{
    return expirydate;
}
public  String getDuration()
{
    return duration;
}
public  String getLastsignature()
{
    return lastsignature;
}
public String getReviewtermyear()
{
    return reviewtermyear;
}
public String getReviewtermmonth()
{
    return reviewtermmonth;
}
public String getMilestone()
{
    return milestone;
}
public String getMilestoneduedate()
{
    return milestoneduedate;
}
public String getPaymentduedate()
{
    return paymentduedate;
}
public String getCapturepenalites()
{
    return capturepenalites;
}
public String getReport()
{
    return report;
}
public String getReportingduedate()
{
    return reportingduedate;
}
public String getDocument()
{
    return document;
}
public String getUpload()
{
    return upload;
}
public String getDatauploaded()
{
    return datauploaded;
}

public  void setEffectivedate(String eff)

{
    effectivedate=eff;
}
public  void setExpirydate(String let)
{
    expirydate=let;
}
public  void setDuration(String due)
{
    duration=due;
}
public  void setLastsignature(String last)
{
    lastsignature = last;
}
public void setReviewtermyear(String year)
{
    reviewtermyear = year;
}
public void setReviewtermmonth(String month)
{
    reviewtermmonth = month;
}
public void setMilestone(String mile)
{
    milestone=mile;
}
public void setMilestoneduedate(String milestone)
{
    milestoneduedate = milestone;
}
public void setPaymentduedate(String pay)
{
    paymentduedate = pay;
}
public void setCapturepenalites(String cap)
{
    capturepenalites = cap;
}
public void setReport(String rep)
{
    report =rep;
}
public void setReportingduedate(String report)
{
    reportingduedate = report;
}
public void setDocument(String doc)
{
    document = doc;
}
public void setUpload(String up)
{
    upload= up;
}
public void setDatauploaded(String data)
{
    datauploaded = data;
}

public  void setErrors(String key,String msg)
{
    errors.put(key,msg);

}
</code></pre>

<p>}</p>

<p>please see the code and say me the answres please its urgent </p>

<p>thanks in advance</p>                                                            
View Answers









Related Tutorials/Questions & Answers:
jsp
jsp  how jsp translated into servlets
JSP
JSP  How to run jsp program in eclipse
Advertisements
jsp
jsp  how to create jsp page
Jsp
Jsp  Can I implement interface in jsp
JSP
what is JSP forward tag for  what is JSP forward tag for   It forwards the current request to another JSP page. Below is the syntax for the same:- <jsp:forward page="...url..." /> We can also forward parameter
jsp
jsp  how to include two jsp page
jsp
jsp  how to create a table in oracle using jsp and the table name is entered in text feild of jsp page
jsp
jsp  write a code for jsp file generator to generate a jsp page automatically taking html page as input
JSP
JSP  Hi, What is JSP? What is the use of JSP? Thanks   Hi, JSP Stands for Java Server Pages. It is Java technology for developing web applications. JSP is very easy to learn and it allows the developers to use Java
jsp
jsp   what is the basic necessities reguired for running jsp using JDBC bridge?? and how to write a jsp code to access the detail present in microsoft access pls send link regarding above
jsp
jsp  how to pass jsp variable to an html page
JSP
JSP  relevant difference between servlet and jsp in 1 line
jsp
jsp  how to include google map in our jsp page
JSP
JSP   How to create CAPTCHA creation by using JSP? I need an code for CAPTCHA creation by using JSP...   You can create a captcha validation using jsp. Have a look at the following tutorial: Captcha Creation
jsp
jsp  how to write a servlet and jsp program for user login form
jsp
jsp  how to write a servlet and jsp program for user login form
jsp
jsp  why jsp is translated into servlet?pls describe precisly
jsp
jsp  code for jsp automatic genration using html
jsp
jsp  how to write hindi in jsp and store in database as unicode
JSP
JSP  FILE UPLOAD-DOWNLOAD code USING JSP
jsp
jsp  how to delete data from database using jsp
jsp
jsp  I Want complete note on JSP servlet
jsp
jsp  how to upload image through csv format in jsp
JSP
What are JSP directives, page directives and include directives?  what are jsp directives? and what are page directives? and what are include directives? can you explain taglib directives?   JSP directives JSP
JSP
Can you explain jsp page life cycle what is el how does el search for an attribute in JSP  Can you explain jsp page life cycle what is el how does el...://www.roseindia.net/jsp/simple-jsp-example/LifeCycleOfJspPage.shtml http
JSP
JSP  what are the different scopes an object can have in a jsp page   JSP Scope Variables: Page scope-It makes the data available... the following links: http://www.roseindia.net/jsp/simple-jsp-example
jsp
jsp  how to connect the database with jsp using mysql   Hi Friend, Please visit the following links:ADS_TO_REPLACE_1 http://www.roseindia.net/jsp/connectjspwith_mysql.shtml http://www.roseindia.net/jsp
JSP
what is jstl in JSP   what is jstl   JSTL is also called as JSP tag libraries. They are collection of custom actions which canbe accessed as JSP tags. For more information, visit the following link: JSTL Tutorials
JSP
access application data stored in JavaBeans components. The jsp expression...). Before JSP 2.0, we could use only a scriptlet, JSP expression, or a custom tag to include server state in the jsp page output. For more information, visit
JSP
JSP public opinion poll   Develop a JSP for a news channel to conduct public opinion poll on any topic. Users will respond through yes or no options. Later display the result in percentage
jsp
jsp   Hi all..I am new in jsp. I have a question. I want develope a jsp page it contain two part for two different user group. i want to hide some information from user1 group and same as user2 group. can i do this in single jsp
jsp
jsp  hai please give me the table grid code code for jsp
jsp
jsp  how to create multiple tables in oracle 9i using jsp program
jsp
jsp  Dear deepak, wat is the purpose of converting jsp into servlet and how the process takes place.. with regards, praveen
jsp
jsp  how to assign javascript varible to java method in jsp without using servlet
JSP
JSP  why we use preparedstatement while saving data from jsp to data base table
jsp
jsp  In any jsp all implicit objects are available directly, in such a case why we need PageContext object again
JSP
JSP  how does jsp engines instantiae tag handler classes instances   JSP engines will always instantiate a new tag handler instance every time a tag is encounteredin a JSP page. A pool of tag instances are maintained
jsp
jsp  Hi in my dao class some exception is there then how can i display in jsp page
JSP
JSP  How to include the same jsp page dynamically to a number of times automatically
JSP
JSP  How to include the same jsp page dynamically to a number of times automatically
jsp
jsp  how to edit only one row from multiple row from single jsp page dynamically
jsp
jsp  sir i want to jsp code for online examination like as bank po,,,,,,plz help me sir
jsp
jsp  in my project i have following jsp in this jsp the pagesize=30 but i have to create drop down box with values 10,20,30. and i have to pass them to pagesize how can i do this please help me
JSP
JSP   What is JSP?   JavaServer Pages (JSP) is a server-side Java technology an extension to the Java servlet technology that helps... Pages (JSP) is a server-side Java technology an extension to the Java servlet
JSP
objects in jsp   Implicit objects in jsp are the objects... and are created at the conversion time of a jsp into a servlet. But we can pass.../o/jsp-implicit-objects.shtml
JSP
objects in jsp   Implicit objects in jsp are the objects... and are created at the conversion time of a jsp into a servlet. But we can pass.../jsp-implicit-objects.shtml
JSP
JSP  Consider that we need to have a text, combo, radio & checkbox in JSP page and the page data's are retrieved from
JSP
JSP   Develop a JSP to keep track number of users and display a message â??You are nth visitorâ?? where n is number of user
JSP
how can we use beans in jsp  how can we use beans in jsp   JSP provides three tags to work with beans:- <jsp:useBean id="bean name... that defines the bean. <jsp:setProperty name = "id" property = "someProperty" value

Ads