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 to include two jsp page 

JSP Interview Questions

JSP
what is JSP forward tag for  what is JSP forward tag for   It forwards the current request to another JSP page. Below is the syntax for the same:- <jsp:forward page="...url..." /> We can also forward parameter 

JSP Servlet Questions

Jsp
Jsp  Can I implement interface in jsp 

Java Beginners

jsp
jsp  how to create jsp page 

JSP Servlet Questions

JSP
JSP  How to run jsp program in eclipse 

JSP Servlet Questions

jsp
jsp  how jsp translated into servlets 

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 create a table in oracle using jsp and the table name is entered in text feild of jsp page 

JSP Servlet Questions

JSP
JSP  Hi, What is JSP? What is the use of JSP? Thanks   Hi, JSP Stands for Java Server Pages. It is Java technology for developing web applications. JSP is very easy to learn and it allows the developers to use Java 

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

JSP Servlet Questions

JSP
JSP  FILE UPLOAD-DOWNLOAD code USING JSP 

Development process Questions

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

JavaMail Questions

jsp
jsp  how to pass jsp variable to an html page 

JSP Servlet Questions

jsp
jsp  how to upload image through csv format in jsp 

JSP Servlet Questions

jsp
jsp  I Want complete note on JSP servlet 

JSP Servlet Questions

jsp
jsp  how to delete data from database using jsp 

HTML Questions

jsp
jsp  code for jsp automatic genration using html 

JSP Interview Questions

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

JSP Servlet Questions

JSP
JSP  relevant difference between servlet and jsp in 1 line 

JSP Servlet Questions

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

JSP Servlet Questions

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

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 include google map in our jsp page 

JSP Interview Questions

JSP
What are JSP directives, page directives and include directives?  what are jsp directives? and what are page directives? and what are include directives? can you explain taglib directives?   JSP directives JSP 

JSP Interview Questions

JSP
Can you explain jsp page life cycle what is el how does el search for an attribute in JSP  Can you explain jsp page life cycle what is el how does el...://www.roseindia.net/jsp/simple-jsp-example/LifeCycleOfJspPage.shtml http 

JSP Interview Questions

JSP
JSP  what are the different scopes an object can have in a jsp page   JSP Scope Variables: Page scope-It makes the data available... the following links: http://www.roseindia.net/jsp/simple-jsp-example 

JSP Interview Questions

JSP
what is jstl in JSP   what is jstl   JSTL is also called as JSP tag libraries. They are collection of custom actions which canbe accessed as JSP tags. For more information, visit the following link: JSTL Tutorials 

Java Server Faces Questions

JSP
access application data stored in JavaBeans components. The jsp expression...). Before JSP 2.0, we could use only a scriptlet, JSP expression, or a custom tag to include server state in the jsp page output. For more information, visit 

JSP Servlet Questions

JSP
JSP public opinion poll   Develop a JSP for a news channel to conduct public opinion poll on any topic. Users will respond through yes or no options. Later display the result in percentage 

DMCA.com