Home Discussion Discuss: Introduction to JSP

  • Introductiondharmendra singh bora May 14, 2011 at 3:24 PM

    name dharmendra singh bora,job data analyst in gbpuat pantnagar,

  • jspGUNA July 7, 2011 at 2:41 PM

    hi i m new to dis. i ple send execution process of the jsp to my mail.

  • execution of jspmala July 11, 2011 at 7:59 PM

    iam confused while executing jsp in internet explorer . if my jsp program is saved as myfirstjsp.jsp then where do i save it. if i save it in this path C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\myweb\myfirstjsp.jsp then while executing in internet explorer if i give this path http://localhost:8080/myfirstpage then it is not executing instead it mentions the requested resource(myfirstjsp) is not available . so please help me.

  • jspK.DevenderReddy July 6, 2011 at 8:05 AM

    in java programs we write user defined package for ex package info.student; public class Bill{ public static void main(String ar[]){ //code } } as like above program how to write user defined package in jsps. please reply.

  • javaK.DevenderReddy July 6, 2011 at 8:10 AM

    how to write user defined exceptions in java

  • servletsk.DevenderReddy July 6, 2011 at 8:12 AM

    how to retrieve date from html form and how to store in database server in servlets.

  • jspv raj August 17, 2011 at 4:16 PM

    good

  • learn jspmurali August 27, 2011 at 6:58 PM

    i am not study basic of jsp

  • jspnavya-n December 8, 2011 at 10:17 AM

    nice

  • javasldjf December 30, 2011 at 2:27 PM

    nice

  • Jsp&servletsPrashanth January 26, 2012 at 10:43 PM

    The diffences between servlet and jsp

  • GoodSatish January 11, 2013 at 9:42 AM

    Good

  • jsp in htmlgupta February 7, 2012 at 10:51 PM

    i want all tags in jsp in html language

  • facing database connection problemankit March 5, 2012 at 3:14 PM

    when i connect jsp page to mysql through (import) con.java, i am getting..org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\gasagency\register_jsp.java:6: package agency does not exist import agency.*; ^ 1 error org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351) org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415) org.apache.jasper.compiler.Compiler.compile(Compiler.java:458) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) plz reply soon

  • Need NotesAnbu Raja March 22, 2012 at 10:54 PM

    I need full notes for JSP and XML

  • code not executedrobin poulose April 15, 2012 at 5:03 PM

    http://www.mycgiserver.com/~jdbc/myfirstpage.jsp page not found error 404 not running!!

  • jspajay May 24, 2012 at 1:07 AM

    good

  • hi pujitha!!charishma June 1, 2012 at 2:17 PM

    <html> <head> <link href="calendar.css" rel="stylesheet" type="text/css"> <script src="calendar.js" type="text/javascript"></script> <script type="text/javascript"> function validate(form) { var c_emp_name=/^[A-Za-z ]{3,25}$/; var c_emp_id=/^[0-9]{5}$/; var c_des=/^[1-4]$/; var c_dept_name=/^[1-9]{1}$/; var c_head_id=/^[0-9]{5}$/; var c_sal=/^[1-5]$/; var c_email=/^[A-Za-z0-9_@.]{5,20}$/; var c_phone=/^[0-9]{10}$/; var c_address=/[A-za-z0-9 ]{5,50}$/; var c_Q1=/[A-za-z0-9 ]{5,50}$/; var c_exp=/[0-9]{1,2}$/; var c_user_id=/[A-Za-z0-9_]{5,15}$/; var c_password=/[A-za-z0-9]{5,15}$/; var c=/^[A-Y]{1}$/; var emp_name=form.emp_name.value; var emp_id=form.emp_id.value; var DOB=form.DOB.value; var sex=form.sex.value; var des=form.des.value; var dept_drop=form.dept_name.value; var head_id=form.head_id.value; var sal=form.sal.value; var email=form.email.value; var phone=form.phone.value; var DOJ=form.DOJ.value; var address=form.address.value; var Q1=form.Q1.value; var exp=form.exp.value; var user_id=form.user_id.value; var password=form.password.value; var d=c; if(!c_emp_name.test(emp_name)) { alert("Enter a valid Employee name"); c='Z'; } if(!c_emp_id.test(emp_id)) { alert("Enter a valid Employee id"); c='Z'; } if(!c_des.test(des)) { alert("Select a valid Desgination"); c='Z'; } if(!c_dept_name.test(dept_drop)) { alert("Enter a valid department id"); c='Z'; } if(!c_head_id.test(head_id)) { alert("Enter a valid Head_id"); c='Z'; } if(!c_sal.test(sal)) { alert("Select a valid Amount"); c='Z'; } if(!c_email.test(email)) { alert("Enter a valid email_ID"); c='Z'; } if(!c_phone.test(phone)) { alert("Enter a valid Phone number"); c='Z'; } if(!c_address.test(address)) { alert("Enter a valid Address"); c='Z'; } if(!c_Q1.test(Q1)) { alert("Enter a valid Qualification"); c='Z'; } if(!c_exp.test(exp)) { alert("Enter a valid experience"); c='Z'; } if(!c_user_id.test(user_id)) { alert("Enter a valid user_id"); c='Z'; } if(!c_password.test(password)) { alert("Enter a valid password"); c='Z'; } if(!c.test(d)) { alert("Form Submitted successfully"); } } </script> </head> <body> <h1>Creating accounts for Faculty</h1> <form name="form" method="post" action="faccount.jsp" style="padding:5px;" onsubmit="return validate(this)"> <p> <label>Faculty Name: </label> <input name="emp_name" type="text" class="txt" id="emp_name" size="20"> </p> <p> <label>Employee ID: </label> <input name="emp_id" type="text" class="txt" id="emp_id" size="5"> </p> <p> <label>Date of Birth: </label> <input name="DOB" type="text" class="txt" id="DOB"> <script type="text/javascript"> calendar.set("DOB"); </script> </p> <p> <label>Gender: </label> <input type="radio" name="sex" value="M" checked="default" /> Male <input type="radio" name="sex" value="F" /> Female</p> <p> <label>Designation: </label> <select name="des" class="txt" id="des"> <option value="">--</option> <option value="1">Lecturer</option> <option value="2">Ass.Professor</option> <option value="3">Professor</option> <option value="4">Head of the department</option> </select> </p> <p><label>Department Name:</label> <select name="dept_name" class="txt" id="dept_name"> <option value="">--</option> <option value="1">CSE</option> <option value="2">IT</option> <option value="3">ECE</option> <option value="4">EIE</option> <option value="5">EEE</option> <option value="6">CIVIL</option> <option value="7">MECHANICAL</option> <option value="8">BIO-TECH</option> <option value="9">MMM</option> </select> </p> <p> <label>Head ID: </label> <input name="head_id" type="text" class="txt" id="head_id" size="5"> </p> <p> <label>Date of Joining: </label> <input name="DOJ" type="text" class="txt" id="DOJ"> <script type="text/javascript"> calendar.set("DOJ"); </script> </p> <p><label>Salary:</label> <select name="sal" class="txt" id="sal"> <option value="">--</option> <option value="1">15000</option> <option value="2">25000</option> <option value="3">40000</option> <option value="4">60000</option> <option value="5">90000</option> </select> </p> <p><label>Email:</label> <input name="email" type="text" class="txt" id="email"> </p> <p><label>Phone Number:</label> <input name="phone" type="text" class="txt" id="phone" size="10"> </p> <p><label>Address:</label> <textarea name="address" type="text" class="txt" id="address" size="50" rows="2" columns="25"></textarea> </p> <p><label>Qualification:</label> <input name="Q1" type="text" class="txt" id="Q1" size="50"> </p> <p><label>Experience:</label> <input name="exp" type="text" class="txt" id="exp" size="2"> </p> <p><label>User ID:</label> <input name="user_id" type="text" class="txt" id="user_id" size="15"> </p> <p><label>Password:</label> <input name="password" type="text" class="txt" id="password" size="15"> </p> <p> <input type="submit" name="Submit" value="Submit"> <input type="reset" name="reset" value="Reset"> </p> </form> </body> </html> <-------------Jsp file------------------> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import ="java.sql.*" %> <%@ page import ="javax.sql.*" %> <%@ page import ="java.sql.DriverManager" %> <%@ page import ="java.sql.Connection" %> <%@ page import ="java.sql.SQLException" %> <% String emp_name=request.getParameter("emp_name"); String emp_id=request.getParameter("emp_id"); String DOB=request.getParameter("DOB"); String gender=request.getParameter("sex"); String designation=request.getParameter("des"); String email=request.getParameter("email"); String phone=request.getParameter("phone"); String address=request.getParameter("address"); String head_id=request.getParameter("head_id"); String Q1=request.getParameter("Q1"); String dept_drop=request.getParameter("dept_name"); String date_join=request.getParameter("DOJ"); String exp=request.getParameter("exp"); String salary=request.getParameter("sal"); String faculty_check="1"; String Q2=""; String Q3=""; String Q4=""; String photo=""; String userid=request.getParameter("user_id"); String password=request.getParameter("password"); String id=request.getParameter("emp_id"); String usertype="2"; Class.forName("com.mysql.jdbc.Driver"); java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql", "root",""); Statement st= con.createStatement(); ResultSet rs1=st.executeQuery("select dept_ID,head_id from department where dept_drop='"+dept_drop+"'"); rs1.next(); String dept_id=rs1.getString(1); String x=rs1.getString(2); String sql=("INSERT INTO employee VALUES('"+emp_id+"','"+emp_name +"','"+faculty_check+"','"+DOB+"','"+gender+"','"+designation+"','" +email+"','"+phone+"','"+address+"','"+head_id+"','"+Q1+"','"+Q2+"','"+Q3+"','"+Q4+ "','"+dept_id+"','"+date_join+"','"+exp+"','"+salary+"','"+photo+"')"); st.executeUpdate(sql); String sqll=("INSERT INTO login_details VALUES('"+userid+"','"+password+"','"+usertype+"','"+id+"')"); st.executeUpdate(sqll); String sq=("UPDATE department SET head_id='"+head_id+"' WHERE dept_drop='"+dept_drop+"'"); st.execute(sq); con.close(); %> END

  • queryastha jain June 8, 2012 at 1:42 AM

    please give the explanations sequentially to the example given above...... so that the user could also get the knowledge of running the program accurately.............

  • jspgnana June 15, 2012 at 10:25 AM

    its very helpful to learn the basics of jsp.....

  • ajaxnithya July 3, 2012 at 4:03 PM

    i need a ajax code for updating the multiple values in the form.dynamically to display the value in browser window from the web server

  • jspvinay July 9, 2012 at 1:27 PM

    Write a program using JSP that enables any student to change the medium of instruction of his/her programme of study. Make necessary assumptions.

  • Good OneSanjay July 27, 2012 at 6:22 PM

    THis is good tutoril i have found here..! THNKS

  • javaArul velanganni September 6, 2012 at 4:56 PM

    how to develop the program knowledge.how to learn the java in tutorial.

  • J2EEm.mugi December 15, 2012 at 12:47 PM

    GIVE ME MORE MAIL ALERTS ABOUT THIS CONCEPT TO LEARN IT BY MY SELF

  • requestMaruthi Reddy April 2, 2013 at 2:26 PM

    sir, JSP better than Servlet or not?

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
JSP Servlet Questions

jsp
jsp  how jsp translated into servlets 

JSP Servlet Questions

JSP
JSP  How to run jsp program in eclipse 

Java Beginners

jsp
jsp  how to create jsp page 

JSP Servlet Questions

Jsp
Jsp  Can I implement interface in jsp 

JSP Servlet Questions

jsp
jsp  how to create a table in oracle using jsp and the table name is entered in text feild of jsp page 

HTML Questions

jsp
jsp  write a code for jsp file generator to generate a jsp page automatically taking html page as input 

JSP Servlet Questions

jsp
jsp  how to connect the database with jsp using mysql   Hi Friend, Please visit the following links: http://www.roseindia.net/jsp/connectjspwith_mysql.shtml http://www.roseindia.net/jsp/Accessingdatabase-fromJSP.shtml 

JDBC Questions

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 Servlet Questions

jsp
jsp  how to include google map in our jsp page 

JSP Servlet Questions

jsp
jsp  how to write a servlet and jsp program for user login form 

JSP Interview Questions

jsp
jsp  why jsp is translated into servlet?pls describe precisly 

Development process Questions

jsp
jsp  how to write hindi in jsp and store in database as unicode 

JSP Servlet Questions

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 Servlet Questions

jsp
jsp  how to write a servlet and jsp program for user login form 

JavaMail Questions

jsp
jsp  how to pass jsp variable to an html page 

JSP Servlet Questions

JSP
JSP  relevant difference between servlet and jsp in 1 line 

HTML Questions

jsp
jsp  code for jsp automatic genration using html 

JSP Interview Questions

JSP
JSP  why we use preparedstatement while saving data from jsp to data base table 

JSP Interview Questions

JSP
JSP   What is JSP?   JavaServer Pages (JSP) is a server-side Java technology an extension to the Java servlet technology that helps... document types.   Hi, Here is the answer. JavaServer Pages (JSP 

JSP Servlet Questions

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 Interview Questions

jsp
jsp  hai please give me the table grid code code for jsp 

JSP Servlet Questions

jsp
jsp  how to create multiple tables in oracle 9i using jsp program 

JSP Servlet Questions

jsp
jsp  Dear deepak, wat is the purpose of converting jsp into servlet and how the process takes place.. with regards, praveen 

Java Beginners

jsp
jsp  how to assign javascript varible to java method in jsp without using servlet 

JSP Servlet Questions

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 Servlet Questions

JSP
JSP  i need coding for auto text and auto complete of my database for my JSP with out using plugin if any one know answer if any one know's coding for it give me some suggestion 

JSP Servlet Questions

JSP
JSP   My question is How to create referral hyperlink to the target websites using JSP/JAVA/HTMl...? for eg:assume gmail is the target website...take google as the base website...there are referral hyperlinks 

Development process Questions

Jsp
Jsp  how can we compile the jsp file in dos command prompt. when i enter the jspc filename.jsp in cmd i got the error like 'jspc' is not recognized... to my file and compilation for the jsp file 

JSP Interview Questions

jsp
jsp  Hi How can we display sqlException in a jsp page? How can we mantain session in jsp? Thanks Kalins Naik   JSP SQL Exception <...; </font> </body> </html> Session in JSP JSP Working 

Java Beginners

JSP
; Hi Friend, Please visit the following links: http://www.roseindia.net/jsp/javascriptpagerefresh.shtml http://www.roseindia.net/jsp/user-registration-form 

DMCA.com