Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Login application in MVC2.0 ..  RSS feed

 
harish pathak
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

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.


Thanks
 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using standard container managed security or security feature implemented by the application itself?
 
harish pathak
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Anupam Sinha
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!