Specify view-id for "Non-JSF" resources

Splash Forums PrettyFaces Users Specify view-id for "Non-JSF" resources

This topic contains 2 replies, has 3 voices, and was last updated by  0swald 9 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #18247


    I noticed in the documentation that it is possible to specify non-jsf resources for view-id of a url-mapping.

    I have a servlet which serves an iText pdf, so has no associated JSP, or view of any kind.

    How can I use “pretty:monthly-report” in my JSF code:


    <url-mapping id="monthly-report" parentId="lang">
    <pattern value="/site/#{site}/report/#{month}/#{year}/report.pdf"/>
    <view-id value="/MonthlyReportServlet"/>



    Yes, it should be possible to use the URL of a Servlet as a viewId in a mapping. Actually PrettyFaces just forwards the request to the viewId, so every URL that your container knows about should work.

    What exactly is your question? How you would use this mapping? You could for example use the <pretty:link> component to create a link to the URL.

    BTW: You don’t need to use a Servlet for this. You could also simply create your content in an URL action. See this article for details:




    Wow, shame on me! Being your fan for already two years, never read this article and used to code servlets for such sort of tasks :)

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.