Having problem with javabean that generate password

i have created a javabean for generating password.
this is my java coding.
package autogenerate;
import java.util.*;
public class GeneratePwId
private String Passwd;
public String getPasswd()
return this.Passwd;
public void setPasswd(String Psd)
char[] letters = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'J', 'K', 'L', 'M', 'N', 'P', 'R', 'T',
'U', 'V', 'W', 'X', 'Y', 'a', 'b', 'c',
'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
'm', 'n', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z', '0', '1', '2',
'3', '4', '5', '6', '7', '8', '9'
Psd = "" ;
while( Psd.length() < 10 )
Psd += letters[ (int)( Math.random() * letters.length ) ] ;
this.Passwd = Psd;
and trying to use a jsp to retrieve this password.
<html>
<head>
<title>
Try retrieving password
</title>
</head>
<body>
<jsp:useBean class="autogenerate.GeneratePwId" id="bean0" scope="page"/>
<%
String Password = bean0.getPasswd();
out.println(Password);
%>
<%=bean0.getPasswd()%>
</body>
</html>
i try to retrieve the password from javabean and display it out. but the result i got is always null. may i know what is the problem with my javabean? or my jsp?
can anyone help me please?
Thanks alot

this is my .java code for getter and setter
package autogenerate;
import java.util.*;
public class GeneratePwId
private String passwd;
public String getPasswd()
     return this.passwd;
public void setPasswd(int length)
char[] letters = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a',
'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1',
'2', '3', '4', '5', '6', '7', '8', '9'
String psd = "" ;
length = 10;
while( psd.length() < length )
psd += letters[ (int)( Math.random() * letters.length ) ] ;
this.passwd = psd;
and this is my jsp code
<html>
<head>
<title>
Try retrieving password
</title>
</head>
<body>
<jsp:useBean class="autogenerate.GeneratePwId" id="bean0" scope="page"/>
<%
String Password = bean0.getPasswd();
%>
<%=Password%>
<%=bean0.getPasswd()%>
</body>
</html>

Similar Messages

  • Problem with Servlet that generates HTML

    Hello,
    I have a servlet that connects to a database to get some information which it displays in a HTML file generated by the same servlet.
    For each line that I want to display from the Database I create the following in my servlet:
    <input type="hidden" value="Ajax-Chelsea" name="bet_1_choice"/>
    However, when I test it in Tomcat it doesn't work, and I realised in Firefox that it gets the above line as follows with the bold part added:
    <input type="hidden" )="" value="Ajax-Chelsea" name="bet_1_choice"/>
    I also use a javascript to add the DB information in another area of the HTML page, another table, but I don't know if this is relevant.
    I don't understand what is wrong. Can someone help me please?

    Thanks for your responses.
    Actually the problem was my javascript. Now it is sorted out.

  • I'm having problems with iTunes that keeps changing the genre of music that I have already changed

    I'm a Dj and I make extensive use of inteligent playlists mostly defined by genre and classification.
    I currently have about 70 different playlists, and almost everyone are very important, because I know what music to play, but in some cases I don't remember the name. So it's very usefull for me to know where I can find it according to the genre that I defined.
    BUT!! WHAT HAPPENS IS THAT iTunes keeps changing the genre of some music to the previous that is available on the itunes store (that I don't use because is too vague)
    Do you know what might be happening?

    Hello Torre,
    DAQmx is in fact more efficient than Traditional DAQ, so this behavior you describe shouldn't be the rule. I haven't been able to debug/check thoroughly your code, so here's what I suggest:
    a) Try the W2000 option to give more time to background processes (see this link).
    http://zone.ni.com/devzone/conceptd.nsf/webmain/28A6979ECA9A0CAF862569050053D92D?opendocument
    b) Try with the LabVIEW supplied DAQ examples which do a similar task and test/compare their performance
    c) Check with the LabVIEW tools where the time is spent (Profile VIs tool)
    Hope this will help !
    Regards,
    JorgeM.

  • Hi, I've a Power Mac (7200/120) and like to convert regional files into windows. English files are ok but am haveing problems with files that was written in Bengali version using Bengalics(font) I would appreciate ur help.s

    Hi, I'm new to this forum want help from you...
    I've a Power Mac (7200/120) & been using for almost 10 years. Now the light of the Monitor is fadeing within five min. I've huge files
    written in Bengali Language with a font named BengaliCS. I want to convert this files to Windows so that I can edit those files into
    window. I heard there are softwares that convert Mac to Window but don't know they can convert to regional language.
    I would appreciate if one can help me on this.
    thanks

    chand@007 wrote:
    I've huge files
    written in Bengali Language with a font named BengaliCS. I want to convert this files to Windows so that I can edit those files into
    window.
    You need to tell us A) what app did you create those files with? and B) what format are they in (.doc, .txt, etc)?
    It may be possible to just transfer the files and your font to another machine without conversion depending on how they were made.
    Where did you get the BengaliCS font?

  • I'm having problems with forgotten id and password

    I had an Ipod but had to sell it because of childrens needs and now I cant remember either user name or passwords and I have had to create a new account and have lost all the music that I have purchased over the last year ...

    Apple ID: How to find your Apple ID
    Apple ID: If you forget your password

  • Help !  Having problem with program that converts .pdf to .doc file

    I just purchased the program that converts a pdf file to a docx or doc file and it worked fine.   the form looks great BUT when i tried to use it tonight, the first line typed just find.   After that letters are typing over other letters and the space bar does not work...  what could i be doing wrong or does this producct not work?

    I don't think this is a Adobe program, or is it?  What's the name of the program?

  • Having problems with key chain password

    I just got my mac book yesterday, and I'm having problems with my keychain password.
    My keychain password is not the same as my login password, it won't accept it, so i think i made a typing error.
    Each time i go on to safari, it asks for the password, which i don't have. i've tried the key chain first aid, and that still doesn't work. I've also tried keychain access, and that also doesn't work as it asks for the password first!
    Is there a way that i can reset it?

    There are user passwords and Administrator passwords. The only way to check your keychain password is to be the administrator. In an effort to secure my MacBook, I have an administrator account that I don't use at all and I have a user account that is all I use. It is a great way to protect your MacBook info from others.
    As to your question, passwords are case sensitive. You can try to change the password by inserting the CD's that came with your MacBook and reset the password. Seeing that you just got it yesterday, you probably don't have much personal information on it yet, you could use disk utility from the CD and reinstall the Operating System.
    Good Luck.
    Adam

  • I am having problems with creating my apple id. On the phone it is advising me that the ID is not created and then when i do it online it says that it has been created. Can you advise me on what to do please?

    I am having problems with creating my apple id. On the phone it is advising me that the ID is not created and then when i do it online it says that it has been created. Can you advise me on what to do please?

    Apple ID FAQ   http://support.apple.com/kb/HE37

  • I'm having problems with excessive email usage on my iphone 4/ios 7. Just noticed that (settings/usage) it was using 900  mb. I deleted all my mail, deleted the mail account, and it still says it's using 661 mb. My ipad uses a fraction of that.

    I'm having problems with excessive email usage on my iphone 4/ios 7. Just noticed that it (settings/usage) was using 900+ mb. I deleted all my mail, deleted the mail account, turned the phone off and back on, downloaded any remaining mail on the server to Outlook on my computer, and it still says it's using 661 mb. My ipad uses a fraction of that.
    Background: I recently (December) bought an ipad and set up icloud for contacts and calendar, but NOT mail. My email provider is Verizon. I use computer, iphone, and ipad to check my email; eventually I download it from the server using Outlook on the computer and then delete any remaining emails from the phone and ipad. I can't find info on this problem anywhere.

    Howdy there COUGAR444,
    It sounds like your iPad all of a sudden seems to be restarting out of no where. If you haven't called AppleCare yet, I would start with quitting either the app that seems to be causing the issue, or all the apps if a single doesn't seem to be the culprit. 
    iOS: Force an app to close
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    When you have done that restart the device and test the issue again:
    iOS: Turning off and on (restarting) and resetting
    If the issue persists, backup your device to iTunes, then restore it as new and verify that it works. 
    How to erase your iOS device and then set it up as a new device or restore it from backups
    If it does, then restore your backup to either verify it still works and the software just needed reinstalled, or isolate the issue to the backup file itself. 
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • Hi am having problems with iTunes,I have all my music on my 4s but I bought the iPhone 5 today.us there any way that I can transfer music over to my new phone without using the library?as it doesn't seem to be on my PCM anymore.

    Hi am having problems with iTunes,I have all my music on my 4s but I bought the iPhone 5 today.is there any way that I can transfer music over to my new phone without using the library?as it doesn't seem to be on my PC anymore.i reset my pc and save my iTunes to a hard drive but can't access it.Need help please

    " When I did this, my library showed all the music I have "purchased" from itunes but did not have the music that I downloaded a long time ago through itunes from my old CDs."
    Correct.
    " How can I get that music to show up in my library now on my new computer?  "
    Copy it from your old computer or your backup copy of your old computer.
    The sync is one way - computer to ipod.

  • TS3694 Hi,I have an iphone 3g that is "not" jailbroken,nor have I tried,however,I had been having problems with it shuting down&not starting again so I updated&tried to restore only to have an error 1015.The iphone is now stuck on the connect to itunes,pl

    Hi, I have an Iphone 3g that is "Not" jailbroken, nor do I want it to be jailbroken. However, I had been having problems with it shuting down and not starting again. So, I tried to update and restore only to get an "error" 1015.
    It is now stuck on "connect to itunes"
    Any help would be great as this is a factory unlocked phone

    Apple in no way blocks devices.
    Carriers can blacklist devices from their network.  If that is what has occurred, only the carrier can remove the blacklist.  This should have nothing to do with your ability to activate the device and use it as an iPod.

  • TS1702 Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.

    Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.

    Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.

  • Anyone know why my itunes says I need to re-install and that it's having problems with Microsoft Visual C

    Anyone know why my itunes says I need to re-install and that it's having problems with Microsoft Visual C++?

    See... Unable to install or open > http://support.apple.com/kb/TS5376
    Also See this User Tip by turingtest2
    https://discussions.apple.com/docs/DOC-6562
    littlered1382 wrote:
      I am also concerned that I will lose all of the things that I have backed up from my phones, purchases, apps, etc.
    It has always been Prudent to Create and Maintain a Backup of anything you would not like to lose.

  • Hi all. I recently restore my old iphone 5 on my new 6. I'm having problems with bluetooth devices. The ones that were already paired with the old one are not showing in the list, and most of them(not all) are not working or pairing. I already restod

    Hi all. I recently restore my old iphone 5 on my new 6. I'm having problems with bluetooth devices. The ones that were already paired with the old one are not showing in the list, and most of them(not all) are not working or pairing. I already restored network settings to no avail. Any ideas?

    What's more, they don't even show on the bluetooth devices list..

  • HT204150 I'm having problems with random contacts disappearing from icloud. I have a saved text from a contact that displays her info but when I look for her in contacts it's missing.

    I'm having problems with random contacts disappearing from icloud. I have a saved text from a contact that displays her info but when I look for her in contacts it's missing.

    It is locked to your sisters carrier.
    She would have to ask her carrier if they unlock iPhones and if she qualifies for this service.

Maybe you are looking for

  • I cannot print a PDF from Adobe Acrobat Pro or Adobe Reader with Mavericks!

    I cannot print a PDF from Adobe Acrobat Pro or Adobe Reader.  I tried on both MacBook Pros we have here, both now with Mavericks.  Error message says "Opening printer connection failed.  Unable to open printer connection . . . "  This is after it say

  • How to set the width and heigh in the popup window

    Hi All, I tried to show a report in a popup window style. In the column link section, I defined the URL like the following: javascript:popupURL('f?p=&APP_ID.:128:&SESSION.::&DEBUG.::P128_PAY_RATE,P128_PAY_TERMS:#PAY_RATE#,#PAY_TERMS#'). how and where

  • Outgoing messages not working with POP e-mail account

    I am getting a strange message each time I try to send outgoing e-mail messages with my iPhone 3G. It says that my recipients e-mail address in invalid. I have tried multiple e-mail addresses and it always says the same thing when I try to send. My o

  • Decryption Failed Error 4498, Microsoft Remote Desktop on Mac OSX Mavericks

    Our work server is hosted on the cloud. Every few minutes I get an error that reads: "Decryption using Standard RDP Security mechanisms failed (code DecryptFailed(4498))". I click OK, and it closes the remote desktop session. I re-open the session an

  • Sony 14:9 FCpro 16:9 screen size in overlays...

    I'm working in FCpro (6-.) for some years now making my own home movies. This spring I got a Sony HDR-HC9 1080i cam what made it more beautiful, recording in 16-9 etc. So I set my FC to the needed settings, exported to compressor and to DVD studio to