Tags: application, architecture, assigned, code, customerlogin, java, jsp, login, module, mvc2, mvc20, pages, provide, server
Login application in MVC2.0 ..
I have assigned a module that is CustomerLogin and I have to make this in MVC2.0 architecture.
Can anyone please provide me the code.
please reply soon.
Leave a comment...
- 3 Comments
- Are you using standard container managed security or security feature implemented by the application itself?#1; Tue, 15 Jul 2008 08:27:00 GMT
- Thanks for your prompt respone, well we are not using any security feature.
Its a simple demo that I have to develop.
Please give me a clear idea how to develop code for this application.
As far as my knowledge concern we will make three files for making Login application in MVC2.0:
1) CustomerLogin.jsp (View)
2) LoginServlet.java (Servlet as a controller)
where we have only methods that is to be used for validation.
If I am not wrong that is validator and deligator but am not much clear about these two terms - Validator and Deligator.
3) LoginBean.java (Bean as a business logic)
where we will create sql statement and fetch the data from database and other logic..
Is there any other file that is to be created ?
If anyone has some idea and or can send me the code...
Please reply soon.
Thanks#2; Tue, 15 Jul 2008 08:28:00 GMT
- Hi Harish
I don't think so that you would be able to get the code from here all you would get is some insight.
Here is what I would have done.
First the View. Login.jsp
The login.jsp should submit the request to the Servlet. Either the servlet can validate and delegate the request or it can only delegate the request. If this is just a demo and you would not be adding more code (more files and more logic) then delegation and validation can be done by the servlet. Otherwise leave the servlet only for delegation.
In case servlet is only delegating then forward the request to a Login.java which would validate the request. In case it finds it ok then again there can be two options. Depending on your application size either you can write the DB code here only or you can again delegate the DB related work to a DB specific class which would be called by the Login.java. After this the response should be sent back to the servlet which should show the next page.#3; Tue, 15 Jul 2008 08:29:00 GMT