473,378 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

servlets

rohitrohitrohit
hi plez.help me.

The code i written below is generated in response when a user click a button in a servlets.
for changing user password , generated response coding is written below by me.it's working properly.
In this response i make currentpasswordfiledTextbox,Securityquestiontextbo x and newpasswordfield and confirmpasswordfield for taking input from user to update his password.
my problem is that if user doesnot entered same values in newpassword field and confirmpasswordfield then a error message display to him.
so,how can i check these values {it has to be same in both textboxes}?
how can i use javascript inside a servlets?




Expand|Select|Wrap|Line Numbers
  1.           out.print("<html>"); 
  2.          out.print("<head>");
  3.          out.print("</head>");
  4.          out.print("<body bgcolor=\"White\">");
  5.          out.print("<img src=\"C:/j2sdkee1.2.1/public_html/musicsworld/img/PasswrodCheck.jpg\">");
  6.          out.print("<hr width=\"765\" height=\"60\" color=\"red\">");
  7.          out.print("<font face=arial size=4 color=Black>To reset your password, provide your current password OR the answer to your security question");
  8.          out.print("<form method=post  action=\"http://127.0.0.1:8000/LoginServletf/UpdatePasswordChecka\">");
  9.          out.println("<br>");
  10.          out.print("<TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" BGCOLOR=\"#fc6c6\" ALIGN=\"CENTER\"> ");
  11.  
  12.          out.print("<TR>");
  13.          out.print("<TD>");
  14.          out.println("<font face=arial size=3 color=white>These values must be match  as you give at Registration Time...");
  15.          out.print("</TR>");
  16.          out.print("</TD>");
  17.  
  18.          out.print("<TR>");
  19.          out.print("<TD>");
  20.          out.println("<br>");
  21.          out.print("</TR>");
  22.          out.print("</TD>");
  23.          out.print("<TR>");
  24.          out.print("<TD>");
  25.          out.print("<INPUT TYPE=\"radio\" NAME = \"group1\" VALUE = \"0\">Current Password    
  26.  
  27.  
  28.  
  29.        <INPUT TYPE=\"Password\" SIZE=\"25\" NAME=\"currentpassword\"> ");
  30.          out.print("</TR>");
  31.          out.print("</TD>");
  32.  
  33.          out.print("<TR>");
  34.          out.print("<TD align=left>");
  35.          out.println("<font face=arial size=4>     OR");
  36.          out.print("</TR>");
  37.          out.print("</TD>");
  38.  
  39.          out.print("<TR>");
  40.          out.print("<TD>");
  41.          out.print("<INPUT TYPE=\"radio\" NAME = \"group1\" VALUE = \"1\" CHECKED>"+UserQuestion+"    
  42.  
  43.       <INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"Answer\">");
  44.          out.print("</TR>");
  45.          out.print("</TD>");
  46.  
  47.          out.print("<TR>");
  48.          out.print("<TD>");
  49.          out.println("<br>");
  50.          out.print("</TR>");
  51.          out.print("</TD>");
  52.  
  53.          out.print("<TR>");
  54.          out.print("<TD>");
  55.          out.print("New Password  
  56.  
  57.  
  58.  
  59.  
  60.          ");
  61.          out.print("<INPUT TYPE=\"Password\" SIZE=\"25\" NAME=\"newpassword\">");
  62.          out.print("</TR>");
  63.          out.print("</TD>");
  64.  
  65.          out.print("<TR>");
  66.          out.print("<TD>");
  67.          out.println("<br>");         
  68.          out.print("</TR>");
  69.          out.print("</TD>");
  70.  
  71.          out.print("<TR>");
  72.          out.print("<TD>");
  73.          out.print("Confirm new password  
  74.  
  75.  
  76.  
  77.       ");
  78.          out.print("<INPUT TYPE=\"Password\" SIZE=\"25\" NAME=\"Confirmnewpassword\">");
  79.          out.print("</TR>");
  80.          out.print("</TD>");
  81.  
  82.          out.print("<TR>");
  83.          out.print("<TD>");
  84.          out.println("<br>");
  85.          out.print("</TR>");
  86.          out.print("</TD>");
  87.  
  88.  
  89.          out.print("<TR>");
  90.          out.print("<TD align=\"center\">");
  91.          out.print("<INPUT TYPE=\"SUBMIT\" VALUE=\"Save\" ALIGN=\"MIDDLE\">     "); 
  92.          out.print("</TR>");
  93.          out.print("</TD>");
  94.  
  95.          out.print("<TR>");
  96.          out.print("<TD>");
  97.          out.println("<br>");
  98.          out.print("</TR>");
  99.          out.print("</TD>");
  100.          out.print("</Table>");
  101.          out.print("</form>");
  102.          out.print("</body>");
  103.          out.print("</html>");
Nov 2 '07 #1
1 1077
r035198x
13,262 8TB
1.) Use code tags when posting code
2.) Don't write all that static HTML from a servlet. Create a separate JSP for it and pass it the required dynamic content from the servlet.
Nov 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: N.K. | last post by:
Hi, I'm using Tomcat 7.2 and I'm trying to deploy an aplication that uses JSP and servlets. I'm actually trying to duplicate a production server but can't get it right. In the directory...
1
by: Sascha Pohlmann | last post by:
hello, I have the following problem: I would like to evacuate the logic from my jsp files in servlets. servlets provide database contents prepared in HTML tables, the jsp files are supposed...
3
by: Jose Munoz | last post by:
Hi all, I want to share some data for all my applications (servlets and jsps). For this i am using a JSP to set the variables with scope=application. When i get this data from some JSP all is o.k,...
0
by: Ruaan Kruger | last post by:
Hi there, I'm a junior java programmer that has just started working on j2ee. The company I worked for is currently using Struts for all new implementations etc. The problem is however that...
3
by: InterEC.NET | last post by:
Hello, Is there any C++ library or tool that is similar in functionality to what java servlets offer. We run an engineering job search website which is running on a home brewed java servlet...
3
by: Bit Byte | last post by:
I have written a custom servlet engine (and "wrapper" servlets) for some legacy code (C/C++) that I have. The servlets contain the bulk of my 1st 2 layers in a 3 tier architecture - i.e. data...
2
by: prakashsurya | last post by:
gud evening i need a help about servlets its a bit urgent actually the problem i am facing is when i use doGet method i am getting the result in servlets but when i am going for doPost i am...
0
by: ank99 | last post by:
hello...i m trying to run servlets(using GET) from wml page..... using apache tomcat 5.5 server and WinWap for Windows(version 3.2.1.28.)....its working fine as far as just to display wml form...
1
by: ank99 | last post by:
hello...i m trying to run servlets(using GET) from wml page..... web server : apache tomcat 5.5 server WAP Browser: WinWap for Windows(version 3.2.1.28.).... its working fine as far as just to...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.