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



Home Answers Viewqa Java-Beginners online test project on java using servlets and jsp

Have Programming Question? Ask it here!
 
 
 


saraswathi k
online test project on java using servlets and jsp
1 Answer(s)      2 years ago
Posted in : Java Beginners


as i am doing online test project on java using jsp and servlets ,,,the problem is in the code of jsp file which i have sent,...,i used next and previous buttons and used two form tags ..,i need to place the next button and previous button side by side,but problem occuring calling servlet...,if place buttons in one row side by side,..,action performing for both button is same ,i mean it will call nextaptiduteservlet action only always,,,if i take of the form tag of preservlet out of table ...,both buttons works properly .....,so i want a solution for placing the two buttons side by side and the action should be performed properly......,


Advertisement
View Answers

July 30, 2012 at 11:46 AM


Here is a jsp application. Here we have created a table test(ques,op1,op2,op3,op4,ans) and answers(id,ans).

1)form.jsp:

<%@page import="java.sql.*"%>
    <html>
    <form method="post" action="result.jsp">
    <table>
    <%
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root";, "root");
    Statement st=connection.createStatement();
    ResultSet rs=st.executeQuery("Select * from test");
    int i=1;
    while(rs.next()){
    %>
    <tr><td><%=i%></td><td><%=rs.getString("ques")%></td><td><input type="radio" value="<%=rs.getString("op1")%>" name="radio<%=i%>"/><%=rs.getString("op1")%></td><td><input type="radio" value="<%=rs.getString("op2")%>" name="radio<%=i%>"/><%=rs.getString("op2")%></td><td><input type="radio" value="<%=rs.getString("op3")%>" name="radio<%=i%>"/><%=rs.getString("op3")%></td><td><input type="radio" value="<%=rs.getString("op4")%>" name="radio<%=i%>"/><%=rs.getString("op4")%></td></tr>

    <%
    i++;
    }
    %>
    <tr><td><input type="submit" value="submit"></td></tr>
    </table>
    </form>
    </html>

2)result.jsp:

    <%@page import="java.sql.*"%>

    <%
    String st[]=new String[10];
    for(int i=0;i<st.length;i++){
    int j=i+1;
    st[i]=request.getParameter("radio"+j);
    System.out.println(st[i]);

    }
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root";, "root");
    Statement stmt=connection.createStatement();
    ResultSet rs=stmt.executeQuery("Select ans from answers");
    String ans="";
    while(rs.next()){
    ans+=rs.getString("ans")+" ";
    }
    int count=0;
    String answers[]=ans.split(" ");
    for(int i=0;i<answers.length;i++){
    if(st[i].equals(answers[i])){
    count++;
    }
    }
    out.println("Your "+count+" answers are correct");
    %>


Related Tutorials/Questions & Answers:
online test project on java using servlets and jsp
online test project on java using servlets and jsp  as i am doing online test project on java using jsp and servlets ,,,the problem is in the code...;Here is a jsp application. Here we have created a table test
online test project
online test project  i need online test project in java using struts...kindly help..   Have a look at the following link: http://www.roseindia.net/struts/struts/struts2.2.1/onlinetestapp
Advertisements
online test software using jsp and servlet
online test software using jsp and servlet  online test software using jsp and servlet
Online Test System Project
Online Test System Project  I want a full ready-made project on online test system in jsp. i am not using servlet but only jsp.And backend database...://www.roseindia.net/jsp/online-quiz-application-jsp.shtml
Online Test System Project
Online Test System Project  I want a full ready-made project on online test system in jsp. i am not using servlet but only jsp.And backend database as mysql. my email address is help me. send a full project on online test system
need a sample project using java technologies like jsp, servlets, struts
need a sample project using java technologies like jsp, servlets, struts  Hi everybody! I have learnt core java,jdbc,jsp,servlets & struts... other project with detailed explanation using the above technologies by which i
Using Servlets, JSP for Online Shopping
Using Servlets, JSP for Online Shopping  What is wrong with my code ? JSP <form action="LoginServlet "method="post" > <table> <tr ><td>Username:</td><td><input type="text" name="Id
online test application in java
Online Test Application Table Of Contents Introduction To Application Database Design Creating Data Access Object (DAO) Design Pattern Creating Views Writing Actions Mapping Application Admin Module User Module Download
online test application in java
online test application in java  Can questions come in html file (test.html) if we link test.jsp with test.html   We have taken... the following link: http://www.roseindia.net/jsp/online-quiz-application-jsp.shtml
online examination system project in jsp
online examination system project in jsp  How many tables are required in SQL for online examination system project in jsp in java
online examination system project in jsp
online examination system project in jsp  How many tables are required in SQL for online examination system project in jsp in java my email id
Online test
Online test   I am creating a project for online test system... and it will show on the same page,on completion of test it will show result and that result will also store in the database.The code must be in JSP-SERVLET using
online examination system project in jsp
online examination system project in jsp  How many and which data tables are required for online examination system project in jsp in java. please give me the detailed structure of each table
Should we go for javascript or applets for online exam project using java
Should we go for javascript or applets for online exam project using java  Hi, I am new to java and i am working on online examination project.As soon as the candidate login successfully a window pop up should appear
Java project in online examination system
Java project in online examination system  how many and which tables are required at backend as SQL for online examination system project in jsp
Register page using servlets,jsp and java beans
Register page using servlets,jsp and java beans  i want code for register page using jsp,serlets and java beans.iam getting error for my code in java...://www.roseindia.net/jsp/user-registration-form-using-jsp.shtml Thanks
online examination system project in jsp
online examination system project in jsp  I am doing project in online examination system in java server pages. plz send me the simple source code in jsp for online examination system
online shopping code using jsp
online shopping code using jsp  plz send me the code of online shopping using jsp or jdbc or servlets plz plz help me
online examination system project in jsp
online examination system project in jsp  How to show the status bar which shows how much time is remaining in online examination system in jsp.my
online examination system project in jsp
online examination system project in jsp  Thanks for providing me the 6 tables.But I want to know will the id field of answers1 table be same for all questions of Set1? Will it be 1 or will be 1,2,3,... What
online examination system project in jsp
online examination system project in jsp  thanks for providing me 6 tables for online examination system. I want to know what will the id field of Answers1 table contain? Will it contain same id for all the questions of Set1 &
online examination system project in jsp
online examination system project in jsp  thanks for providing me 6 tables for online examination system. I want to know what will the id field of Answers1 table contain? Will it contain same id for all the questions of Set1 &
Project on mailing system using Java/JSP
Project on mailing system using Java/JSP  I am making a project on mailing system in Java/JSP. How could I display the inbox messages on the home page of user? Please tell me about how to handle these messages in database
online test system
online test system  Hi, I am creating a project for online test.../online-quiz-application-jsp.shtml http://www.roseindia.net/answers/viewqa/JSP... question and it will show on the same page,on completion of test it will show
online shopping project
online shopping project  sir, plz can u send me the coding of simple application of online shopping cart project using jsp and servlets which should be run in netbeans without any errors
online shopping project in java - JDBC
online shopping project in java  hii, i am doing a project online shopping in JSP-SERVLET.I wanted to know that i need 2 use images which... as the project runs or should I open connections only when I am required to retrieve
online shopping project in j2ee - JSP-Servlet
online shopping project in j2ee  hello, I am making a project online shopping using jsp-servlet. I wanted to know that how do I implement following: 1) A non-registered user(or a registered user who has not signed-in) can browse
code for timer in java netbeans for online test series countdown timer
code for timer in java netbeans for online test series countdown timer  code for timer in java netbeans for online test series countdown timer
online shopping project in j2ee - JSP-Servlet
online shopping project in j2ee  hello, I am doing a project on online shopping implementing it with only jsp-servlet.I wanted to know that do I need to incorporate any of struts or EJB in my project (in any possible case which I
How to export web page to excel using java or jsp or servlets
errors. Please can anyone tell me how to do this using java or jsp or servlets...How to export web page to excel using java or jsp or servlets  Hi I am trying to export web page(jsp page ) to excel using jsp or servlets. I am
online shopping project report with source code in java
online shopping project report with source code in java  Dear Sir/Mam, i want to a project in java with source code and report project name online shopping. thank you
java Servlets - JSP-Servlet
java Servlets  Hi i am having a doubt regarding servlets as i am... getting data from db and again i have to add that data to textbox using html here i am not using any jsp's. i got up to retriving data from data base but i am
java servlets - JSP-Servlet
java servlets  how to get the parameter value of input type file using java servlets  Hi, You can use request.getParameter(). In Jsp, --- --- IN servlet, String fileName=request.getParameter('fl'); If you
courier management service (using servlets,jsp,jdbc)
courier management service (using servlets,jsp,jdbc)   is anyone having information about courier management service ? plz share it .its urgent THANKING YOU IN ADVANCE
java servlets - JSP-Servlet
java servlets  I am using eclipse . please help me to write a web application that follows mvc architecture and use jdbc connection pooling for oracle 10g
online project tracking system
online project tracking system  hello sir , I chintan patel and my question is as under how to assign project for admin to project manager in jsp servlet project my project name is "online project tracking system " and i am
Online quiz mini project
Online quiz mini project  Hi. I follow one of the code for "Online quiz mini project". I would like to know how to count the number of wrong answers in jsp
java-servlets - JSP-Servlet
java-servlets  I have one doubt.if we update resume in jobportal websites, at that place i saw only some fields are possible to edit at a time. how is it possible. pls clarify my doubt any one. I will be thankful to you
java project - JSP-Servlet
java project  i am going to do a mini-project on computerization... which i wanted to do ... and i want to implement it thru Servlets and JSP's... mini-project... where all the students can enter into the application
using jsp and servlets andin Mvc architecture
using jsp and servlets andin Mvc architecture  how to insert a form data in different tables, that means education details in education table, address details in address table,like that and finally if we fetch all must come
Online quiz mini project
Online quiz mini project  Sir i need a online quiz program coding using java servlet, jdbc odbc connection with ms. access. If possible send that source code to me. Thank you
online shopping project
online shopping project  Hi, i want online shopping project modules description and screens
online shopping project
online shopping project  Hi, i want online shopping project modules description and screens
Online project management degrees
Online project management degrees  Is there any Online project management degrees course available? What are the duration of the course? Thanks   Hi check the page Online Business Management Degree. Thanks
Regarding a project in java - JSP-Servlet
Regarding a project in java  am doing a project on Tiny ETL(Extract Transform and Load), using jsp-servlets. Can u help me out by giving some... friend, Plz specify the technologies you have used like JSP/Servlet/Struts/J2EE
online bookstore - JSP-Servlet
online bookstore  i want to display some books like online shoping.please send me code for that using jsp and servlets
i want to do a project using jsp and servlet....What are all the materials i need to study
i want to do a project using jsp and servlet....What are all the materials i need to study   i want to do a project using jsp and servlet....What... links: JSP shopping cart Struts Shopping Cart Struts Online test application JSP
core java project by using databse
core java project by using databse  hello sir, i'm a b.tech final year student.... i wantto make a project on java with database... can u plzz suggest me how i can start for it.... means on which topic i can make project
using servlets and jsp technologies search the documents - Development process
using servlets and jsp technologies search the documents   write a program to develop search contents,uploading data and advance searching options using servlets and jsp with source code
code to send sms alerts using jsp online
code to send sms alerts using jsp online  I am new to mobile aplication development. pls send me the code for sms alerts after clicking the button
 

 

 

DMCA.com