I've been looking into JSF and at the same time, clarifying my understanding of MVC.
Example:
OrderSessionBean has a method called 'getLineItems'. In the JSP, we want to pull that list of line items in to display via JSTL. But, an error occurs.
How do you respond to pulled content when the data should be pre-validated? Or, am I looking at MVC pull incorrectly? I would like to allow the view dictate what/when content is displayed, but how do we respond to issues?
I was looking at one JSF example where the Action/Controller was part of the user's session as a bean, you update the session bean's state and ask it controller/type questions. I think this is a great idea for application level logic.
If we were to modify my example above and say that instead of calling 'getLineItems' we would, at render time, call an OrderSessionBean.getLineItemsAction(). It would be able to say, here are the line items and here is how i want to respond to the request for data within the view.
I know this is a ramble-- but if anyone would like to include their insight. Thanks!
-
MVC Pull Error Handling (JSF) (2 messages)
- Posted by: Jacob Hookom
- Posted on: February 02 2004 02:44 EST
Threaded Messages (2)
- MVC Pull Error Handling (JSF) by Kris Thompson on February 02 2004 10:28 EST
- MVC Pull Error Handling (JSF) by Jacob Hookom on February 02 2004 11:53 EST
-
MVC Pull Error Handling (JSF)[ Go to top ]
- Posted by: Kris Thompson
- Posted on: February 02 2004 10:28 EST
- in response to Jacob Hookom
I've been looking into JSF and at the same time, clarifying my understanding of MVC.
>
> Example:
> OrderSessionBean has a method called 'getLineItems'. In the JSP, we want to pull that list of line items in to display via JSTL. But, an error occurs.
>
> How do you respond to pulled content when the data should be pre-validated? Or, am I looking at MVC pull incorrectly? I would like to allow the view dictate what/when content is displayed, but how do we respond to issues?
So far sounds like you have everything correct. Pull MVC means that you get to choose what you want and where in the view you want it. If you are getting an error it must be a technical issue, not so much a logical one.
>
> I was looking at one JSF example where the Action/Controller was part of the user's session as a bean, you update the session bean's state and ask it controller/type questions. I think this is a great idea for application level logic.
>
> If we were to modify my example above and say that instead of calling 'getLineItems' we would, at render time, call an OrderSessionBean.getLineItemsAction(). It would be able to say, here are the line items and here is how i want to respond to the request for data within the view.
Is your issue with where the processing takes place or do you want to get your technical issue resolved? -
MVC Pull Error Handling (JSF)[ Go to top ]
- Posted by: Jacob Hookom
- Posted on: February 02 2004 11:53 EST
- in response to Kris Thompson
So far sounds like you have everything correct. Pull MVC means that you get to choose what you want and where in the view you want it. If you are getting an error it must be a technical issue, not so much a logical one.
The question is how to resolve technical issues at that level. I'm used to Struts with an emphasis on MVC Push, where all the data is essentially pre-validated and pushed to the page-- logical or technical validation included.
> Is your issue with where the processing takes place or do you want to get your technical issue resolved?
I'm looking for best practices for cases where data being pulled into a page and there are possible issues. Or am I conceptually putting too much emphasis on the capabilities of MVC pull and should assert that data pulled into the page is pre-validated (In the case of pre-fetching lineItems from an order to make sure everything is alright with the lineItems before allowing them to be pulled in at the view level)?