Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


monisha
servlet not working properly ...pls help me out....its really urgent
1 Answer(s)      3 years and 3 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>

Advertisement
View Answers

July 21, 2011 at 10:19 AM


Please go through the following link:

Servlet Tutorials



Related Tutorials/Questions & Answers:
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
Advertisements
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
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 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...........
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
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
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
code not working properly
code not working properly  protected void doPost(HttpServletRequest...("text/html"); PrintWriter out=response.getWriter(); HttpSession..... please help
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>
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
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
I really need help with this assignment question Please help me out Please
I really need help with this assignment question Please help me out Please  * Description* You are hired to develop a laptop inventory information system for Sheridan College in order to keep track of the information about
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
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
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
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
help me - JSP-Servlet
help me   how to open one compiled html file by clicking one button from jsp
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
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
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
plz help me!!!!!!!! - JSP-Servlet
plz help me!!!!!!!!  i`ve set the environment varaibles for tomcat as well as jdk.. but i`m not understanding where i`ve to save my servlet..i.e.... there are compilation errors.. plz do help me.   make sure that you did
Pls anyboby tell me...
Pls anyboby tell me...  which book easy to learn spring
Advertisements
 

 

 

DMCA.com