Before insert the user name u must check the user exiting or not ...
if exiting menas throw an error to a one jsp page ..
else insert !!
Main Topics
Browse All Topicsi have an HTML page in that i am entering username.
this username i want to store in text file in servlet .
example : If it is a new user, i want to reply to the user with a message: userName is registered successfully!eg. John is registered successfully! . If this username has been used, i want to reply to the user with a message:userName has been registered already!(eg. John has been registered already!).
but if i enter andy once again it should give me an error saying username already exixts.
can anyone help.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Check this out, there is a Logging Servlet Access example using Filters:
http://java.sun.com/produc
dear pramodkrjsr,
above code works fine however when i enter user name andy , it gets stored in data.txt.
it also gives error if i retype andy . how ever if i typed sam , it gets written in data.text , but if i try to login by same name sam it should give me an message user already register. but it does not and duplicate entry of sam gets store.
code works fine only for first user , after that duplicate entries of other name gets store.
do i have to add an for loop for reading data in text file ? because it seems its reading and checking only fist name in the data.txt. ?
Business Accounts
Answer for Membership
by: dravidnsrPosted on 2009-10-25 at 09:20:28ID: 25657073
Erro only u need right ??