I am new to jsp. I have created a simple login page. Now i want to save/retrieve the password in textfile. The following is my code to save the username and password. I have save one user and password. Now i want to append new users in the same file. Can anyone please suggest me how to append the new users login details in same file. Also i would like to save the password and display some otherpage on buttonclick. BufferedWriter objWriter = new BufferedWriter(new FileWriter("/home/gayathri/eclipse-workspace/Simplelogin/WebContent/WEB-INF/file.txt")); objWriter.write(username + "#" + password ); objWriter.newLine(); objWriter.close();

Member Avatar
Member Avatar
+0 forum 1

hai all, i want to know the system user name and password when iam running the web page in jsp to oracle thanks.

Member Avatar
Member Avatar
+0 forum 1

i've been tried some code : a.html : <div class="content"> <a href="howto_google_maps.asp">Google Maps</a><br> <a href="howto_css_animate_buttons.asp">Animated Buttons</a><br> <a href="howto_css_modals.asp">Modal Boxes</a><br> <a href="howto_js_animate.asp">Animations</a><br> <a href="howto_js_progressbar.asp">Progress Bars</a><br> <a href="howto_css_dropdown.asp">Hover Dropdowns</a><br> <a href="howto_js_dropdown.asp">Click Dropdowns</a><br> <a href="howto_css_table_responsive.asp">Responsive Tables</a><br> </div> b.html (1st trial), i got this from w3schools : <html> <head> <script src="js/jquery-3.3.3.min.js"></script> <script> function includeHTML() { var z, i, elmnt, file, xhttp; /*loop through a collection of all HTML elements:*/ z = document.getElementsByTagName("*"); for (i = 0; i < z.length; i++) { elmnt = z[i]; /*search for elements with a certain atrribute:*/ file = elmnt.getAttribute("w3-include-html"); if (file) { /*make an HTTP request using the attribute …

Member Avatar
+0 forum 0

JSP page: <div id="ADDBUTTON" style="vertical-align: bottom;margin-left: 10px;display: none;"> <label style="text-align: center;" class="titleblue_s4" >Add Part Description</label><br> <div class="Table"> <div class="Row"> <div class="Cell"><label class="graylabel2">Enter Part:</label><font color="red">*</font></div> <div class="Cell"><s:textfield cssClass="text" name="partEntered" id="partEntered" value="%{partEntered}" theme="simple" size="50" onkeydown="return validatetext(event);" onkeypress=" return validatetext(event);" /> </div></div><div class="Row"> <div class="Cell"><label class="graylabel">Part Description:</label></div> <div class="Cell"> <s:textfield cssClass="text" name="addpartdescrp" id="addpartdescrp" value="%{addpartdescrp}" theme="simple" size="50" maxlength="200" onkeydown="return validatetext(event);" onkeypress=" return validatetext(event);"/> </div> </div> <br> <div class="Row"> <div class="Cell"></div><div class="Cell"><input type="button" id="addbutton" value="Submit" onclick ="Acttt(this.value);" /></div></div> </div> </div> Javascript: function Acttt(str) alert(str); //var EmptyPart=document.getElementById("partEntered").value; var EmptyPart1=document.getElementById("partEntered"); var EmptyPart=EmptyPart1.value; alert(EmptyPart); if(!EmptyPart.match(/\S/)) alert ('Empty value is not allowedd'); return false; if(typeof EmptyPart == null || …

Member Avatar
Member Avatar
+0 forum 1

Hi all, How to store data in two different tables when we click the button. Suppose I have a 2 tables named as team1 and team2. In table team1 have 2 fields teamid,teamname In table team2 have 3 fields team2id,team2name,teamid here teamid is foreign key. So when i click on insert button all the data will be inserted to respective tables i need jsp and oracle codes i dont know any idea of this how to do that task can you please help me any one its arjent for me please . Thanks

Member Avatar
+0 forum 0

Hi all, How to store data in two different tables when we click the button. Suppose I have a 2 tables named as team1 and team2. In table team1 have 2 fields teamid,teamname In table team2 have 3 fields team2id,team2name,teamid here teamid is foreign key. So when i click on insert button all the data will be inserted to respective tables i need jsp and oracle codes i dont know any idea of this how to do that task can you please help me any one its arjent for me please . Thanks

Member Avatar
+0 forum 0

the below code is to list the running exe files in the windows task manager. but i need only the running applications in windows task manager. if aybody knows pls help me by sending code for this. i am awaiting pls. import java.io.*; import java.util.*; public class GetProcess { public static List listRunningProcesses() { List<String> processes = new ArrayList<String>(); try { String line; Process p = Runtime.getRuntime().exec("tasklist.exe /nh"); BufferedReader input = new BufferedReader (new InputStreamReader(p.getInputStream())); while ((line = input.readLine()) != null) { if (!line.trim().equals("")) { // keep only the process name processes.add(line.substring(0, line.indexOf(" "))); } } input.close(); } catch (Exception …

Member Avatar
Member Avatar
+0 forum 7

I am working on a reservation app in Java and it is almost complete but I keep getting this error when running my app: Exception in thread "main" java.util.NoSuchElementException: No line found at java.base/java.util.Scanner.nextLine(Scanner.java:1651) at ReservationCalculator.main(ReservationCalculator.java:34) Full Code import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; import java.util.Scanner; public class ReservationCalculator { double perNight = 115.00, totalPrice; long noOfDays; int m, d, y; LocalDate arrivalDate, departureDate; public static void main(String[] args) { System.out.println("Welcome to the Reservation Calculator"); System.out.println(); Scanner sc = new Scanner(System.in); ReservationCalculator rc = new ReservationCalculator(); String choice = "y"; while(choice.equalsIgnoreCase("y")) { rc.accept(); System.out.println(rc.getArrivalDateFormatted()); System.out.println(rc.getDepartureDateFormatted()); System.out.println(rc.getPricePerNightFormatted()); System.out.println(rc.getTotalPriceFormatted()); choice = sc.nextLine(); …

Member Avatar
Member Avatar
+0 forum 1

Hi, I am trying to create a reserve console app using Java. Any Help is appreciated. The Params are: Calculate reservation totals Welcome to the Reservation Calculator Enter the arrival month (1-12): 5 Enter the arrival day (1-31): 16 Enter the arrival year: 2016 Enter the departure month (1-12): 5 Enter the departure day (1-31): 18 Enter the departure year: 2016 Arrival Date: May 16, 2016 Departure Date: May 18, 2016 Price: $105.00 per night Total price: $210.00 for 2 nights Continue? (y/n): n ------------------------------------------------------------------------------------- · This application calculates the charges for a stay at a hotel based on the …

Member Avatar
Member Avatar
+0 forum 3

We have completely redesigned our website but am not sure about the page content whether its enough to get ranked on search engines? What are all the possibilities available to get ranked immediately on the first page of google - https://www.dezvolta.com/

Member Avatar
Member Avatar
-2 forum 1

# I want to give a button in my JSP page, which on click of it should store an image in the filesystem. # Following is the code ScreenCapture.java which is a servlet. Purpose: To capture the screen of working area and store it in file system. Problem: - An image file is stored in file system with blank image. ## Please help me to fix what is wrong ## . import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.logging.Level; import java.util.logging.Logger; import javax.imageio.ImageIO; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import …

Member Avatar
Member Avatar
+0 forum 3

Sir can you please send me an example to upload an image to the server (with user defined file name and display message if name exist) at specific folder "images" and save its path to the mysql database. And again display the images uploaded on the server folder by using the path which is stored in database. Sir i am able to upload image on server specific folder or the image directly in database in bolb datatype but i become failed to store its path in database and fetch the uploaded image using the path in database. So please guide …

Member Avatar
Member Avatar
+0 forum 6

Hello, Iam new to programming.Can someone please help me out how can i read URL process it and return the number to browser in jsp. Actually I have a URL which returns an integer now what i want is I have to write a program to take the URL as input and return that result back to browser in jsp(or servlet).

Member Avatar
Member Avatar
+0 forum 1

Hello everyone, I am having trouble in displaying the multiple images on jsp. I am using servlet to pull the image from the database. Following code, will always display single image multiple times on my jsp page. Can anyone please help me in rectifying the error in the code. I am new to jsp and servlet programming! Thanks for your anticipation. Fyi, `Inline Code Example Here` Table A: fieldname: personid(datatype: int, primary key) fieldname: person_name(datatype: varchar(20) Table B: fieldname: person_pic(datatype: BLOB) fieldname: personid(foreign key references Table A(id)) fieldname: picid(datatype: int, primary key) Below is the jsp code: <% //uid will …

Member Avatar
+0 forum 0

I need to insert an imagen into a SQL Server Database and i need to do it using jsp, but i don't know how to do it. Someone can teach me the best way to do that?

Member Avatar
Member Avatar
+0 forum 1

I want to print the username on jsp page"**success.jsp**" from "**home.jsp**" i have used **hibernate** to save data in table . "home.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>Insert title here</title> </head> <body> <center> <h1 ><font color="red">User-Interface</font></h1> <form action=loginServlet method="post"> <table border="1" bordercolor="red" style="border-style: dotted;" cellpadding="5px" cellspacing="10px"> <tr> <td>UserName:</td><td><input type="text" name="username"></td> </tr> <tr> <td>Password:</td><td><input type="password" name="password"></td> </tr> </table> <input type="submit" value="Log-In" > </form> New User?<a href="register.jsp"> Register Here</a> </center> </body> </html> success.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"> …

Member Avatar
+0 forum 0

Hi, I'm new to JSP. I want a sample code to call a java class on button click in jsp.

Member Avatar
Member Avatar
+0 forum 3

Hello .Im a final year student in bachelor of science computer in web technology. I need your suggestion for my final year project title.Do you have any related ideas?

Member Avatar
Member Avatar
+0 forum 13

hI! I m trying to create a simple login application in jsp where i create a session allows the user to use certain features and then logout. Problem is that after the user logs out. I destroy all session objects and invalidate the session and redirect to welcome page still, on hitting the back button user can see the login pages, which ideally should not be navigable without login. i have also used this code to disable caching [CODE] <head> <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> </head> ----//body tags <%response.setHeader("Cache-Control","no-cache"); response.setHeader("Pragma","no-cache"); response.setDateHeader ("Expires", 0 ---//my stuff %> …

Member Avatar
Member Avatar
+0 forum 6

test for check more 5 items

Member Avatar
Member Avatar
+0 forum 4

hi i am trying to take an n number of inputs from user where n is user defined .i am a bit confused how to write my jsp so it can as many as inputs required by the user

Member Avatar
+0 forum 0

I want to store multiple checkboxe values in my sql database. I am using jsp as front end.

Member Avatar
Member Avatar
+0 forum 1

I facing a problem with checkbox value that already exists inside the database. so how can I retrieve those value into another database table? The table subject and service below is what I want. But based on the code below the SERVICE TABLE on SUBJECTID COLUMN producing null value. How to remove those null value with subjectid value? I don't understand that well because I am a newbie. SUBJECT TABLE (Values inside subject table already exists) SUBJECTID SUBJECTNAME ----------- ---------------- PT3_ENGLISH ENGLISH PT3_BM BAHASA MELAYU PT3_SC SCIENCE PT3_MATH MATHEMATICS CURRENT SERVICE TABLE IN DB SERVICE TABLE SERVICEID SERVICECATEGORY SERVICETYPE STUDENTID …

Member Avatar
+0 forum 0

//The php section of the code <?php function getJSONFromDB($sql){ $conn = mysqli_connect("localhost", "root", "","rent"); //echo $sql; $result = mysqli_query($conn, $sql)or die(mysqli_error()); $arr=array(); while($row = mysqli_fetch_assoc($result)) { $arr[]=$row; } return json_encode($arr); } $jsonData= getJSONFromDB("select Pic from Display"); $jsn=json_decode($jsonData); //for loop to retrieve rows from database for($i=0;$i<sizeof($jsn);$i++){ $a=$jsn[$i]->Pic; //here is the main problem echo "<html><body><img src='sponsor/$a.jpeg' alt=''></body></html>"; //here is the problem i am facing } ?> 01 //The php section of the code 02 <?php 03 function getJSONFromDB($sql){ 04 $conn = mysqli_connect("localhost", "root", "","rent"); 05 //echo $sql; 06 $result = mysqli_query($conn, $sql)or die(mysqli_error()); 07 $arr=array(); 08 while($row = mysqli_fetch_assoc($result)) { 09 $arr[]=$row; …

Member Avatar
Member Avatar
+0 forum 1

I am trying to create an HTML form which displays text from a text file, using a Java Servlet. I keep getting the following error: Error instantiating servlet class servlets.ReportServlet. Here is the HTML page: <html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <form name = "managementReports" method = "get" action = "ReportServlet"> <input type="submit"> </form> </body> </html> And here is my servlet: package servlets; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import javax.servlet.annotation.WebServlet; @WebServlet(urlPatterns = { "/ReportServlet" }) public class ReportServlet extends HttpServlet { public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { …

Member Avatar
Member Avatar
+0 forum 7

If a table contains field's like name,age tuition fee,bus fee,year, 1,2 When I tried to update 1 year details it is updating but when I try to update the entire fields it's not updating in form of jsp page

Member Avatar
Member Avatar
+0 forum 5

Can anyone help me out to create multiple check boxes for attendance purpose

Member Avatar
Member Avatar
-2 forum 1

As I am doing a application on attendance management where I need to store the details by using check boxes I am unable to store the details of check boxes where it will be generated as present or absent in database Can anyone help me to find out this

Member Avatar
Member Avatar
+0 forum 4

Hi, I'm starting to learn Java EE - JSP / SERVLET and as for my learning progress, I'm trying to achieve this kind of web app but Im having problem with displaying the right selected row (TASK ID Column) from my table. It is populated from my oracle db. Im able to display my expected output correctly. But when I'm trying to get the selected row through clicking the corresponding button, I'm always getting the 1st row value, i.e. ID = '123456', no matter what Button I clicked, 2nd, 3rd, etc. It always display the 1st row. You can kindly …

Member Avatar
Member Avatar
+0 forum 6

I want to have a forum in my website project in school. i don't have any idea. may anyone help me suggesting some examples. it is like daniweb forums. i want to save the topics in the database and retrieve it as a link. i dont know how to do that in jsp code. can anybody help me?? i really need help. God bless you .

Member Avatar
Member Avatar
+0 forum 24

The End.