Home Answers Viewqa JSP-Servlet servlet not working properly ...pls help me out....its really urgent

 
 


monisha
servlet not working properly ...pls help me out....its really urgent
1 Answer(s)      a year and 11 months ago
Posted in : JSP-Servlet

Hi, Below is the front page of my project

1)enty.jsp

</form> </body> </html>

</form> </body> </html>> <html> <body>
> 
>   <form method="post" action="get">
>   <b><div
> style="text-align:center"><font
> size="6"><font
> color="red"></font><font
> color="blue">B-E FORM:</font></div>   
>   <b><font color="marron"
> size="4">ENTER PIS NO.:</font>
>           <input type= "text" name="pis"><br><br>     <input
> type="submit" value="Submit">
> 
> </form> </body> </html></form> </body> </html>

</form> </body> </html>


Now as the user click submit button he will reach to updation.java servlet through WEB.XML

2)**WEB.XML**

<web-app>
<servlet>
        <servlet-name>updation</servlet-name>
        <servlet-class>updation</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>updation</servlet-name>
        <url-pattern>/updation</url-pattern>
    </servlet-mapping>
</web-app>



3)**updation.java**


import java.sql.*; import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*;

public class updation extends HttpServlet {     protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException     {

            int pisNo =Integer.parseInt( req.getParameter("pis") );
         List list=new ArrayList();
            try
                 {
                                    Class.forName("com.mysql.jdbc.Driver");
                        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/drona","root","daemons");

                        Statement st = con.createStatement();
                        ResultSet rs = st.executeQuery("select * from dronadb2 where pisNo=" +  pis );



                 do{
                            list.add(rs.getString("b1"));
                    list.add(rs.getString("b2"));

                    list.add(rs.getString("pyr1"));
                    list.add(rs.getString("univ1"));
                    list.add(rs.getString("subject1"));
                    list.add(rs.getString("gradeyr1"));

                    list.add(rs.getString("pyr2"));
                    list.add(rs.getString("univ2"));
                    list.add(rs.getString("subject2"));
                    list.add(rs.getString("gradeyr2"));

                    list.add(rs.getString("pyr3"));
                    list.add(rs.getString("univ3"));
                    list.add(rs.getString("subject3"));
                    list.add(rs.getString("gradeyr3"));

                    list.add(rs.getString("qual1"));
                    list.add(rs.getString("pyr4"));
                    list.add(rs.getString("univ4"));
                    list.add(rs.getString("subject4"));
                    list.add(rs.getString("gradeyr4"));

                    list.add(rs.getString("qual2"));
                    list.add(rs.getString("pyr5"));
                    list.add(rs.getString("univ5"));
                    list.add(rs.getString("subject5"));
                    list.add(rs.getString("gradeyr5"));

                    list.add(rs.getString("title"));
                    list.add(rs.getString("day6"));
                    list.add(rs.getString("month6"));
                    list.add(rs.getString("yr6"));
                    list.add(rs.getString("gradeyr3"));
                    list.add(rs.getString("day7"));
                    list.add(rs.getString("month7"));
                    list.add(rs.getString("yr7"));
                    list.add(rs.getString("inst"));
                }while(rs.next());
                        req.setAttribute("data", list);
                RequestDispatcher rqd = req.getRequestDispatcher("b-e(1).jsp");
                rqd.forward(req, res);



             rs.close();
                        st.close();
                        con.close();

                }


                catch (Exception e)
                {

                }


                } }


Now the servlet should pass the value retrieve from the database to the text boxes of
 b-e(1).jsp ,

4)**b-e(1).jsp**
Hre radio buttons are also used and i dont know whether i used the correct method to display the data from database via servlet to radio buttons f jsp is correct or not



<%@page language="java" import="java.util.*" %>
<html>
<body>
    <form method="post" action="servlet">
        <% Iterator itr;
             List data=(List)request.getAttribute("data");
            for(itr=data.iterator(); itr.hasNext(); ){
             %>

        <table>
            <tr>
                <fieldset>
                    <div style="text-align:center">
                        <font size="3">
                            <font color="red">* 
                            </font>
                                <font color="blue">
                                    EDUCATION QUALIFICATION
                                </font>
                        </font>
                    </div>
                </fieldset>
                <br>
            </tr>

            <tr>
                <td><font color="blue">Degree</td>
                <td><font color="blue">Passing Year</td>
                <td><font color="blue">Â Â Â Â University/Institute</td>
                <td><font color="blue">Â Â Â Â Â Subject</td>
                <td><font color="blue">Div/Class/Grade</td></font>
            </tr>

            <tr>
                <td>
                <font color="red">*</font><font size="3"><b>Graduation</font><br>
                <fieldset>
                <font color="red"><input type="radio" name="rd1"  value="<%=itr.next()%>" /> Engg.
                <input type="radio" name="rd2"  value="<%=itr.next()%>" /> Non-Engg.</font>
                </fieldset>
                    </td>


                <td>
                    <input type="text" cols="5" value="<%=itr.next()%>" name="year1">
                </td>

                <td>
                    <input type="text" cols="5" value="<%=itr.next()%>" name="inst1">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="sub1">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="year1.1">
                </td>
            </tr>

            <tr>
                <td>
                    Post Graduation
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="year2">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="inst2">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="sub2">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="year2.2">
                </td>
            </tr>

            <tr>
                <td>
                    <font color="red">(Compulsary for Science Graduates)</font>
                </td>
            </tr>

            <tr>
                <td>
                    Ph D/Post doctrate
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="year3">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="inst3">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="sub3">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="year3.1">
                </td>

            </tr>

            <tr>
                <td>
                    <input type="text" value="<%=itr.next()%>" name="qualfi1">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="year4">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="inst4">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="sub4">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="year4.1">
                </td>
            </tr>

            <tr>
                <td>
                    <input type="text" value="<%=itr.next()%>" name="qualfi2">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="year5">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="inst5">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="sub5">
                </td>

                <td>
                    <input type="text" value="<%=itr.next()%>" name="year5.1">
                </td>
            </tr>

        </table>

        <br><br>

        <table>
            <tr>
                <fieldset>
                    <b>
                        <div style="text-align:center">
                            <font size="3">
                                <font color="red">* 
                                </font>

                                <font color="DarkGreen">
                                    DETAILS OF SERVICE
                                </font>
                            </font>                     
                    </b>
                        </div>
                </fiedset>
                <br>
            </tr>

            <tr>
                <td><font color="DarkGreen">Grade/Post</td></font>
                <td><td><td><td><td><font color="DarkGreen">Â Â From</td></font>
                <td><td><td><td><td><td><font color="DarkGreen">Â Â To</td></font>
            </tr>

            <tr>
                <td>
                    <input type="text" name="grade">
                </td>

                <td>
                </td>

                <td>
                </td>

                <td>
                    <input type="text"  name="day6">
                </td>

                <td>
                    <input type="text" name="month6">
                </td>

                <td>
                    <input type="text"  name="year6">
                </td>

                <td>
                </td>

                <td>
                </td>

                <td>
                    <input type="text"  name="day7">
                </td>

                <td>
                    <input type="text"  name="month7">
                </td>

                <td>
                    <input type="text"  name="year7">
                </td>

                <td>
                </td>

                <td>
                <td>

                <td>                
                    <input type="text" name="lb">
                </td>
            </tr>
        </table>

        <br>



    <table>
        <tr><tr><tr>
            <div align="left">
        <div style="background-color:lightgray; border: 1px solid black;padding: 7spx;              text-align: center;width: 300px;">
         <span style="color: blue;">Add New Record Of Service</span>
        </div></div>
            </td>


        </tr>


    </table><br>




    <table>


        <tr><fieldset>
        <div style="text-align:center"><font size="3"><font color="red">* </font><font color="blue">TRAINING COURSES ATTENDED IN THE PRESENT GRADE (including CEP)</font></div>
        </tr></fiedset>

        <br><tr>
            <input type="checkbox" name="" value=""> <font color="red">NIL</font><br>

        </tr>



        <tr>
            <td>Course Title</td>
            <td><td><td><td><td>Â Â From</td>
            <td><td><td><td><td><td>Â Â To</td>
            <td><td><td><td><td>Â Â Institution</td>


        </tr>

        <tr>
            <td>
                <input type="text" value="<%=itr.next()%>" name="title">
            </td>

            <td><td><td><td>
                <input type="text" value="<%=itr.next()%>" name="day8">
            </td>

            <td>
                <input type="text" value="<%=itr.next()%>" name="month8">

            </td>

            <td>
                <input type="text" value="<%=itr.next()%>" name="year8">
            </td>


            <td><td><td><td>
                <input type="text" value="<%=itr.next()%>" name="day9">
            </td>

            <td>
                <input type="text" value="<%=itr.next()%>" name="month9">

            </td>

            <td>
                <input type="text" value="<%=itr.next()%>" name="year9">
            </td>

            <td><td><td><td>
                <input type="text" value="<%=itr.next()%> name="inst">

            </td>
        </tr>


    </table><br>


    <table>
        <tr>
            <tr><tr>
            <div align="left">
        <div style="background-color:lightgray; border: 1px solid black;padding: 7spx;              text-align: center;width: 300px;">
         <span style="color: blue;">Add New Training Course</span>
        </div></div>
            </td>


        </tr>



    <tr>
        <td><input type="submit" value="SAVE AND PROCEED"></td>
        </tr>
<%}%>
    </table>



</form>
</body>
</html>
View Answers

July 21, 2011 at 10:19 AM


Please go through the following link:

Servlet Tutorials









Related Pages:
servlet not working properly ...pls help me out....its really urgent
servlet not working properly ...pls help me out....its really urgent  ... as the user click submit button he will reach to updation.java servlet through WEB.XML 2)**WEB.XML** <web-app> <servlet> <servlet
pls help me it urgent
pls help me it urgent  hey, pls help me i want to know that can we call java/.bat file from plsql/proceudre /trigger
pls help me it urgent
pls help me it urgent  hey, pls help me i want to know that can we call java/.bat file from plsql/proceudre /trigger
pls help me it urgent
pls help me it urgent  hey, pls help me i want to know that can we call java/.bat file from plsql/proceudre /trigger
pls help me sir its urgent
pls help me sir its urgent  thanks for reply, but i am getting this error pls help me its urgent type Exception report message description The server encountered an internal error () that prevented it from
on-line examination project?(urgent pls)
on-line examination project?(urgent pls)  Hello friends... not getting how to transfer the values or how to disable the form ...please help me...... Thanks in advance
code not working properly
code not working properly  protected void doPost(HttpServletRequest...("text/html"); PrintWriter out=response.getWriter(); HttpSession..... please help
pls help me with this question
pls help me with this question  how to write a program in C++ using encapsulation,polymorphism,inheritance and abstraction?(all these concepts should come in a single program
Pls help me with strings
Pls help me with strings  To reverse a every other word in a string. Example :- If the input is "This is a line of message" the output should be "sihT is a line fo message
Pls help me with strings
Pls help me with strings  To reverse a every other word in a string. Example :- If the input is "This is a line of message" the output should be "sihT is a line fo message
Pls help me...........
Pls help me...........  how to use the text file as input to insert the values injdbc?   Please visit the following link: Insert text file data into database
Please help me urgent...........
Please help me urgent...........  For what kind of a problem would use a Tree Set and not a Tree Map For what kind of a problem would use a Tree Map and not a Tree Set   Hello Friend, If you want to display the list
Programming Help URGENT - JSP-Servlet
Programming Help URGENT  Respected Sir/Madam, I am R.Ragavendran. I am in urgent need of the coding. My requirement is as follows: Beside... URGENT
pls. help me - Java Beginners
pls. help me  please help me i do need now if its okay... Consider the method headings: void funcOne(int[] alpha, int size) int funcSum(int x,int y) void funcTwo(int[] alpha, int[] beta) and the declarations: int
urgent...pleAse help me.....please!
urgent...pleAse help me.....please!  please help me urgent! how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
Ple help me its very urgent
Ple help me its very urgent  Hi.. I have one string 1)'2,3,4' i want do like this '2','3','4' ple help me very urgent
urgent help for inserting database in a project
help me out quickly i am searching a lot..creating teh database si ok...urgent help for inserting database in a project   I need some urgent help i have made java application for conducting a quiz which displays 25 mcq's
urgent help for inserting database in a project
help me out quickly i am searching a lot..creating teh database si ok...urgent help for inserting database in a project   I need some urgent help i have made java application for conducting a quiz which displays 25 mcq's
its very urgent please help me
its very urgent please help me  how can i retrieve all images from ms access database and display in jsp pages
Datagrid not working
working. please help me out...Datagrid not working  The code here is working fine, apart from the fact that that I'm using netbeans 6.5 and the servlet v2.5 and struts 1.1.
Please help me... its very urgent
Please help me... its very urgent  Please send me a java code to check whether INNODB is installed in mysql... If it is there, then we need to calculate the number of disks used by mysql
i want to retriev and update in same form but its not working pls help....
i want to retriev and update in same form but its not working pls help....  <p><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html></p> <p>
help me
help me  hi sir pls tell me how to use ajax form validatin from very simple way with two ot three text field pls help me use ajax in php my email id is:- rohit11tripathi@gmail.com pls sir give me some vasic information i know
calender working in struts - Struts
calender working in struts  when i execute the following code ,that is working properly if i convert to struts html tags that code is not working please help me to rectify the problem
Help me
Help me  Hi, LWUIT is working in eclipse j2me for Symbian OS
help me
help me  MY GLASSFISH SERVER NOT START PROPERLY help me warning shows DPL5404:Specification-Version for the optional package [ GNUJAXP ] in the jarfile [ C:\Program Files\Java\jdk1.7.0_02\jre\lib\ext\gnujaxp.jar
Not get ans properly
Not get ans properly  I create db on my system using MS-acess,then I create DSN for program but I still not get answer It throws an Exception "java.lang.classNotFoundException",what is this I don't get plz help me.   
help me
help me  pls... xplain dis code:- function go() { window.location.replace("logout.jsp",'window','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1'); self.close
Image Program Urgent - JSP-Servlet
Text box whatever Emp ID I am selecting.. Please help me to get the exact
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP   ... name, this studentâ??s coursework mark (out of 100 )and this studentâ??s exam mark (out of 100). The marks will be a positive
help me - JSP-Servlet
help me   how to open one compiled html file by clicking one button from jsp
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP   Write a class whose objects will represent students.The class should have three... coursework mark (out of 100)and this studentââ?¬â?¢s exam mark (out of 100
GUI Interface .Reply me with in hour..Its Urgent - Java Beginners
GUI Interface .Reply me with in hour..Its Urgent  Hi ... Now i am doing project for Voting finger print Authentication .. Can any pls assit me.. I... Existing project... Help me
urgent help needed!!!!
access country and state....please help me.... 1)state.jsp: <%@page import
urgent help needed!!!!
....please help me.... 1)state.jsp: <%@page import="java.sql.*"%>
i have a problem to do this question...pls help me..
i have a problem to do this question...pls help me..  Write a program that prompts the user to input an integer and the output the number with the digits reversed. For example if the input is 12345, the output should be 54321
its urgent for me - Development process
its urgent for me  Hi All, this is kalavathi,i am new... using alfresco.it is not working and i am not able to understand what is the problem .can u tell me i will send my total code and error exception also. import
do the combinations in java, pls help me its urhent - Development process
do the combinations in java, pls help me its urhent  import java.util.*; interface Expression { public void interpret(ArrayList exp); } class... one help me: action when condition1 and condition3 action when condition1
Pls review my code - Struts
Pls review my code  Hello friends, this is my code in struts action class this page contains checkboxes and radiobuttons also. when i enter the submit it shows me blank page. can anybody solve my problem its urgent. help me
very urgent : Iam unable to code this program plz help me - RMI
very urgent : Iam unable to code this program plz help me  Write a Multi-user chat server and client.  Hi friend, Chat server is a standlone application that is made up the combination of two-application, server
Programming help Very Urgent - JSP-Servlet
Please please its very urgent.. Thanks/Regards, R.Ragavendran..  ...Programming help Very Urgent  Respected Sir/Madam, Actually my code shows the following output: There is a combo box which contains all the ID's
Struts validation not work properly - Struts
to be validated. what have i missed? is there anything that i forgot... pls help
Help Very Very Urgent - JSP-Servlet
requirements.. Please please Its Very very very very very urgent... Thanks...Help Very Very Urgent  Respected Sir/Madam, I am sorry..Actually the link u have sent was not my actual requirement.. So,I send my requirement
Very Very Urgent -Image - JSP-Servlet
with some coding, its better.. PLEASE SEND ME THE CODING ASAP BECAUSE ITS VERY VERY...Very Very Urgent -Image  Respected Sir/Madam, I am R.Ragavendran.. I am working with JSP and JDBC.. In the home JSP page, there is a button
JSP,JDBC and HTML(Very Urgent) - JSP-Servlet
to ROSEINDIA team.. This is Very Urgent. Plz Plz send me the coding ASAP...JSP,JDBC and HTML(Very Urgent)  Respected Sir/Madam, Thanks for your response. You asked me to give my requirements clearly. My requirement
Autocomplete demo not working
application to run the programme. Please help. It's urgent for me. Thanks
Autocomplete demo not working
application to run the programme. Please help. It's urgent for me. Thanks
Program Arrow selection Most Urgent - JSP-Servlet
Please send me the modified coding asap.. Because I...; Hi friend, This code works properly as your requirement. Thanks
Program Urgent - JSP-Servlet
automatically with the selected Employee ID and Name. Its Very Urgent.. Please send me...Program Urgent  Respected Sir/Madam, I am R.Ragavendran. I am in urgent need of the coding. My requirement is as follows: Beside Enter Employee ID