File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes MVC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "MVC" Watch "MVC" New topic
Author

MVC

priya shankar
Ranch Hand

Joined: May 12, 2003
Posts: 51
Hi all
In MVC...
Controller is going to process the logic by calling EJB Or Bean...
Moreover a controller can have subcontroller(i studied in an article ???)..Then controler redirects the request to jsp pages..
Jsp pages going to retrive data from bean for displaying ..
Here what is the role of Taglib(userdefinded tags)..can taglib contain buisness logics...
If so huv servlet will process it..
controller----->(bean,ejb)
| |

|
jsppage<---------(bean,ejb)
In MVC
1)what is the role of Taglib
2)Actually what Model is going to contain(bean,EJB)if so who process it
Help Pls
priya shankar
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Hi,
The main purpose of Taglib is to hide the complex operation involving scriptlets. For e.g. there could be a JSP page which displays a list of employees in an organization. We can have a tag for this pupose rather than writing a scriptlet which is not modular and reusable.
The web page devloper may not be knowing java and jsp tags help in hiding java.
Model refers to data ans business logic in the application. For e.g. enities such as Employee
Here is a link on MVC
http://java.sun.com/blueprints/patterns/MVC-detailed.html


Groovy
priya shankar
Greenhorn

Joined: May 12, 2003
Posts: 21
Thanks
I like to know who is going to process Model(contoller or View)...
1)Are there any situation when a view(jsp) calls a model
2)Huv a Taglib communicates with javaBean and in what situation
3)Huv Jsp(view) is going to retrive data from ejb(model)to display
Help Pls
priya shankar
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919



1)Are there any situation when a view(jsp) calls a model

It is responsilbilty of the controller to call the model. The main purpose of MVC is loose coupling between various components.

2)Huv a Taglib communicates with javaBean and in what situation
It is possible to write custom tag handler classes that can access the javbeans. The taghandler classes have full access to JSP environment and so can access java beans stored in various scope(page,session,application,request). Please visit Sun's site for a tutorial on JSP.
The taglib access beans whenever they need data. For .e.g an Employee bean can contain emp data, so you taglib will invoke the getter methods to retrieve data.

3)Huv Jsp(view) is going to retrive data from ejb(model)to display
Through the controller. The returned from the model is stored by the controller as a java bean in the appropriate scope which are then used by JSP by javabean or custom tags.
[/QB]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: MVC