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

Have Programming Question? Ask it here!
 
 
 


monisha
servlet not working properly ...pls help me out....its really urgent
1 Answer(s)      3 years 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 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...........
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
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
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>
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
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
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
help me - JSP-Servlet
help me   how to open one compiled html file by clicking one button from jsp
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
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
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
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
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
Plz reply me sir Its urgent - JSP-Servlet
Plz reply me sir Its urgent  Respected Sir/madam, I am R.Ragavendran..Actuaaly,I request you to remember the code which you have provided for me using radio buttons.. You have used the following syntax for checking whether
hi , i cant make this programmer , can any one help me to make it pls - Java Beginners
hi , i cant make this programmer , can any one help me to make it pls  ... program. i cant find delete records or update records  pls can someone make this program for me
Hi.. how to write more than one sheets in a excel file... pls anybody help me....
Hi.. how to write more than one sheets in a excel file... pls anybody help me....  i can write only one sheet in a excel file.. but i want to write... go to second sheet... pls help me.. here my code.. import
help me on jstl- <c:url> - JSP-Servlet
help me on jstl c:url  what is jstl in java
displaying List of records from database in a jsp using ajax, onclick it should display the results ?? its urgent can u help me
displaying List of records from database in a jsp using ajax, onclick it should display the results ?? its urgent can u help me   displaying List... ?? its urgent can u help me
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
output not coming properly - JSP-Servlet
output not coming properly  I am not getting the output properly when i had written my code like below: Add Employee Details for( j=0;j<11;j++) { out.println("Department code
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
I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this
I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this  Can Anyone Help Me In This import java.awt.*; import javax.swing.*; import java.awt.event.*; class SlideShow
Help me
Help me  Hi, LWUIT is working in eclipse j2me for Symbian OS
urgent please, help!
urgent please, help!  how to make jTable unclickable and have unmovable columns, thanks in advance   import javax.swing.*; import java.awt.*; public class SimpleJTableExample{ public static void main(String[] args
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
urgent help needed!!!!
....please help me.... 1)state.jsp: <%@page import="java.sql.*"%>
urgent help needed!!!!
access country and state....please help me.... 1)state.jsp: <%@page import
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
help me
help me  i have done as u directed but nothing happens gud to me..... . i am using netbeans is that matter at all help me and take me out from trouble where to store jfree api to use it for j2ee based project
help me
help me  HI. Please help me for doing project. i want to send control from one jsp page to 2 jsp pages... is it possible? if possible how to do
help me
help me  please send me the java code to count the number of similar words in given string and replace that word with new one
help me..
help me..   what are the component needed by grid computing, cloud computing and ubiquitous computing? discuss about the security of above computing. difference between that 3 computing
Advertisements
 

 

 

DMCA.com