I have a html hyperlink in a web page, <a href="1.jsf">Home</a>,
The problem is, when i click on the hyperlink, the control should be redirected to a jsf bean method, perform some computations and then again the control should be transferred to another jsp web page.
I don't think that this is suitable for JSF - it ignores or breaks too many of the JSF framework requirements.
However, there's a fairly simple alternative. Instead of routing your request via a JSF URL, write a small servlet whose doGet method invokes the JSF bean's method of interest and then forwards to the output JSP.
JSF beans aren't only accessible via JSF - it's perfectly valid to use them in any context as long as what you're doing isn't invoking JSF framework services, since there wouldn't be a JSF context when you invoke from a servlet or JSP.
You could simplify even more by making the target JSP invoke the JSF bean method, but that would violate the idea of Separation of Concerns. You'd get a simpler webapp but sacrifice some flexibility.
An IDE is no substitute for an Intelligent Developer.
Joined: Dec 01, 2007
"You could simplify even more by making the target JSP invoke the JSF bean method, but that would violate the idea of Separation of Concerns. You'd get a simpler webapp but sacrifice some flexibility."
Can you provide me code for this solution?
Help will be greatly appreciated?
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: How to call a jsf bean method from a html hyperlink?