posted 12 years ago
Hi jenifer,
There is no fixed rule regarding what you need to use. It all depends on how you validate the userid and password. Since you are new to jsp , I would suggest you not to use struts as it will make it unnecessarily complex. You can use simple jsp or Java classes for validation.
Some basic guidelines:
1. Use a basic html page for userid and password and put it in a <form> tag. let the action of the form tag point to a validate.jsp( the name can be anything ) file.
2. inside the validate.jsp , you can retrieve the previous useris/password using "request.getParameter('userName')" and password similarly.
3. Then you can pass this to a java method in your java class where you can write the logic for validating it. You can simpley hardcode the logic or if you haave a database , retrieve the data from there and validate.
4. According to the returned value you can do a simple out.println("success") or failure on the jsp.
Once you get this running, you can go on and make it more complex. Since you are new, i would not advise you to start with struts with packages as they do a lot of things for you. Which may look good in the start, but once you get stuck, it will be a nightmare.
So best of luck!!
A TubeBulb May light slowely... But it lights the Brightest..