Results 1 to 5 of 5
- 07-06-2009, 05:21 AM #1
Member
- Join Date
- Jul 2009
- Posts
- 8
- Rep Power
- 0
JSP functions and Java Bean methods
Hi all,
I'm new to jsp and I have a question that I couldn't find an explanation for.
I want to know why most functions are written inside Java Beans instead of JSP pages.
I know this may sound like a silly question but if I can have clarification to my confusion, I'm entirely grateful.
Regards,
Lisa
- 07-06-2009, 08:27 AM #2
Senior Member
- Join Date
- Dec 2008
- Location
- Kolkata
- Posts
- 280
- Rep Power
- 5
JSP should be primarily used for the presentation purpose. We should avoid writing our business logic, data access logic etc. inside jsp pages, rather we should put them in java classes. Moreover if you look on this also makes our code modular. If you have to make any changes in business logic or data access logic you dont need to do any thing in the jsp page, and on the contrary if you have to make some changes in the presentation part you will just make changes in the jsp page, you dont have to do any thing with the java classes.
- 07-07-2009, 01:52 AM #3
Member
- Join Date
- Jul 2009
- Posts
- 8
- Rep Power
- 0
What if I write the inside one jsp, for example logic.jsp and has all my other jsp pages include logic.jsp? Is this advisable?
- 07-07-2009, 05:47 AM #4
Senior Member
- Join Date
- Dec 2008
- Location
- Kolkata
- Posts
- 280
- Rep Power
- 5
No. Because as per MVC-II what you mostly follow in web application these days, three different things had different usage. Model->Bean classes,other helper classes
View->output what the user gets (Generated through jsp) and controller->Servlet.
- 07-07-2009, 07:29 AM #5
Member
- Join Date
- Jul 2009
- Posts
- 8
- Rep Power
- 0
Similar Threads
-
Calling java functions from c++
By khajalid in forum New To JavaReplies: 13Last Post: 10-12-2010, 10:50 PM -
stateless session bean with methods
By mihael in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 01-15-2009, 08:55 PM -
UREGENT-accessing session bean ok but entity bean
By parimal in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 08-28-2008, 01:34 PM -
java copy paste cut and undo functions
By Mr tuition in forum AWT / SwingReplies: 1Last Post: 12-09-2007, 12:02 AM -
How to use Inner bean definitions via nested bean elements
By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 08:36 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks