cancel
Showing results for 
Search instead for 
Did you mean: 

Can we write businesslogic and database connections in jsp page

Former Member
0 Kudos

Hi all,

I need to develop a application in PDK. It includes executing some BAPI's and some business logic. For this purpose, do i need to create a EJB Module project or simple JSP project is sufficient. Please let me know which is better option.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use scriplets in jsp s to write the business logic.Although it is recommended to write the business logic and do the database conn in the dao or ejb if you use the MVC architecture. If you write the business logic in jsp after some time it cannot be maintained but if the business logic is written in ejb for a dao.... it is easy to maintain..... as we separate the presentation layer from the business logic layer.

please give points if the ans is helpfull.

Thanks

ritu

Answers (2)

Answers (2)

0 Kudos

Hi,

You can write the bussiness logic in a JSP page, but it is not recommended as per the MVC architecture. There will be some problems with maintenance.

Regards,

Jashua

Former Member
0 Kudos

Hi,

there are a lot of solutions, the best structured solution is:

-> entityBean

--> sessionBean

---> Bean

-


> Webservice

-


> Java Web Dympro (or JSP)

this give you a lot of advantages (.....), but you can also insert all in a single JSP.... but just don't do it!!!!

Hope this help you,

Vito

Former Member
0 Kudos

Well I suppose you create both projects.

If you work with the Developer Studio create a WebModule project where you develop the parts for the presentation layer (mostly JSPs or simple HTML-Pages) and an EJB project containing Entity Beans and Session Beans, where the Entity Beans hold data from a database and the Session Beans contain the business logic.

You will get a connection to the Session Beans by making a JNDI lookup (either directly in the JSPs or (better style) in a normal java bean which you use via the 'useBean' tag in a JSP).

Regards,

Torben