JSF 2 Content Controller (pull in content based on URI)
I'm new to JSF and am trying to make a content controller. Basically whenever someone makes a request to www.myapp.com/external/** I'd li开发者_开发百科ke to forward to a controller that pulls external content into a page template and spits it out to the user.
For example /external/test/test.html might pull in content from a location XXYYZZ/test/test.html.
I was able to achive this pretty easily in Spring 3, but I'm a little confused on where to start with JSF. I feel like I'd need to create a custom servlet to handle /external/**? But what would the class of this servlet be? What would it consist of?
Any help is appreciated!
I would suggest you not do this with the JSF servlet. Instead, do this with JAX-RS, or a custom servlet, or continue to do it with Spring. Map the custom servlet to a different URL pattern than your JSF pages. That way you can use JSF for the pieces where it is appropriate, and serve your static content as appropriate.
While I've never done so myself, Google yields plenty of examples where people have integrated Sping and JSF.
精彩评论