EJB / MVC Design

M

MP

I have never used MVC design before and was wondering how all you
pro's out there would approach the following:

A user registration and login system.

If I understand correctly the registration and login screens will be
JSP which will then forward to a servlet which will access a EJB? to
do the db work and then serve a JSP page back to the client?

Anyone have any input / suggestions or resources?

Thanks.
 
B

Bryce (Work)

I have never used MVC design before and was wondering how all you
pro's out there would approach the following:

A user registration and login system.

If I understand correctly the registration and login screens will be
JSP which will then forward to a servlet which will access a EJB? to
do the db work and then serve a JSP page back to the client?

Anyone have any input / suggestions or resources?

Look at Struts (or one of the myriad of different frameworks out
there).

Personally, I try to keep the login stuff out of my regular code, so
I've written a Servlet Filter which checks to see if a "UserView" is
in the session. If not, forwards to a login.jsp. If so, then uses that
login information to log into the application server. That way, I
don't have to have the login stuff inside my Servlets...
 
S

Sudsy

Look at Struts (or one of the myriad of different frameworks out
there).

Personally, I try to keep the login stuff out of my regular code, so
I've written a Servlet Filter which checks to see if a "UserView" is
in the session. If not, forwards to a login.jsp. If so, then uses that
login information to log into the application server. That way, I
don't have to have the login stuff inside my Servlets...

Filters are cleaner but I just extended RequestProcessor and basically
perform the same operation: if user isn't logged-in then forward to a
login page.
 
A

Anton V. Goldberg

I have never used MVC design before and was wondering how all you
pro's out there would approach the following:

A user registration and login system.
I usually try to use J2EE security if I can. Then one front controller
servlet, which intercepts all your requests (mapped to *) does
post-processing. Struts supply such servlet for you, if you don't use
Struts, make it yourself.
Anton V. Goldberg
 
S

shay

MVC is quite simple if you are using the correct tool.
The good thing about MVC is that you can use different technologies
for each layer. For a simple login application an EJB might be an
overkill.

Take a look at Oracle JDeveloper 10g tutorial page to see some samples
of MVC architectures such as (JSP-Struts-EJB / UIX-Struts-Toplink).
And try out the Oracle ADF for a simple MVC framework based on struts.
http://otn.oracle.com/products/jdev/collateral/prodtour10g.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top