JSP Servlet with AJAX Example

JSP Servlet with AJAX Example Ajax is a great feature implemented almost in all the websites in some way. It gives really a very good user interface, since things are loading/populating without refresh. It is commonly used in username availability checking, register/login page db level/business level validations etc. We are going to use Ajax with JSP and servlet to calculate […]

569 total views, 1 views today

» Read more

EMI Calculator using JSP, Servlet and Bootstrap

EMI Calculator using JSP, Servlet and Bootstrap: Designing a responsive website reduces the startups to invest separately on android and ios apps. Here we are writting a very simple web application for emi calculator using JSP, Servlet and bootstrap. We used bootstrap in this to integrate responsiveness with JSP pages.     Requirement: Download bootstrap CSS and JS files from […]

1,232 total views, 1 views today

» Read more

Pass values from one jsp to another jsp file

Pass values from one jsp to another jsp file: Form values from one jsp can be sent to another jsp file with action parameter in form and getParameter method in the second jsp file. Things to remember: Mention the jsp2.jsp file in the form action of jsp1.jsp file. In jsp2.jsp file use getParameter() method and pass the name of the […]

492 total views, 1 views today

» Read more

clicked value passing from one jsp to another jsp

Create the first jsp named main.jsp and paste the below code,   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <html> <head> <title>agn</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta name="GENERATOR" content="Rational Application Developer"> </head> <body> <!–<iframe src="http://www.w3schools.com"> <p>Your browser does not support iframes.</p> </iframe> –> <a href="/ToCapitalLetter?a=javadomain">click me</a> </body> </html> Create a servlet named ToCapitalLetter.java and […]

476 total views, 1 views today

» Read more

Dynamically Add and Remove value to dropdown Javascript Example Program

Dynamically add & remove values to dropdownlist in javascript: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>My Jsp</title> </head> <body> <br> <br> Javadomain.in – Dropdown dynamic Values Add and Remove <br> <br> <script type="text/javascript"> function addMe() { var textValue = document.getElementById("txtId").value; var ddlstSize = document.getElementById("ddlstId").length; document.getElementById("ddlstId").options[ddlstSize] = […]

892 total views, 1 views today

» Read more

Passing clicked value from jsp to jsp/servlet

Passing value from jsp to jsp/servlet: We can pass the value from jsp to servlet using, request.getParameter(“text”); //servlet code to get the jsp value where text is the name of the input fields (text field). Passing clicked value from jsp to jsp/servlet: We have to pass the clicked value as get parameter in the href link like below, <a href=”/Myservlet?input=javadomain”> […]

1,720 total views, 8 views today

» Read more

Arabic language in jsp example

Arabic in jsp: Encoding should be changed: We need to change the pageEncoding and charset to utf-8 inorder to get the arabic output. If we leave pageEncoding and charset to “ISO-8859-1” then it will not allow to save the arabic content in the jsp page. If we save by force then it will changed to “??????????” like this. So we […]

394 total views, no views today

» Read more

javascript onclick jsp value passing to servlet

Program: MyJsp.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Javadomain.in</title> </head> <script type="text/javascript"> function document123() { var append_input = document.getElementById("txt").value; document.location.href="/My_Workouts/MyServlet?nav=’"+append_input+"’"; // My_Workouts is the project name. } </script> <body> <label>Enter the text to pass Servlet </label> <input type="text" id="txt" ></input> <button type="button" onclick="document123()">Go to Servlet!</button></div> </body> […]

1,035 total views, 1 views today

» Read more

Javascript onclick Jsp call

Program: Input.jsp   <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Javadomain.in</title> </head> <body> <button type="button" onClick="JavaScript:window.location=’MyJsp.jsp’">Click to call MyJsp Page!</button> </body> </html>   MyJsp.jsp   <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Javadomain.in</title> </head> […]

522 total views, no views today

» Read more

hyperlink value passing from one jsp to another jsp

Program: Input.jsp   <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Javadomain.in</title> </head> <body> <a href="http://localhost:17433/My_Workouts/output.jsp?q=Javadomain+Welcomes+you">Click</a> </body> </html>   Output.jsp:   <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Javadomain.in</title> </head> <body> <%String input = request.getParameter("q"); […]

502 total views, no views today

» Read more
1 2