Announcement Announcement Module
No announcement yet.
Portlet MVC/VAP hitting JSPs problem Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Portlet MVC/VAP hitting JSPs problem


    Not sure if anyone will be able to help as this problem may be specific to the portal that i'm deploying too (VAP 7.0), but any input would be appreciated.

    Essentially i'm having trouble getting any portlet that uses JSPs to render properly. This includes a number of the sample portlet apps provided by Spring.

    When visiting a site with the 'books' portlet, for example, an empty portlet is rendered (i.e. theres a title bar 'books', maximize, minimise etc. but no content).
    I've written my own portlet that uses views that extend AbstractXsltView and this portlet renders correctly.

    I've included some of the output that Spring logs which shows that from its point of view the request has been rendered successfully. It should also be noted that no errors are logged by either VAP or tomcat, even with logging level maximized.

    2005-11-14 16:09:01,580 DEBUG [org.springframework.web.portlet.DispatcherPortlet] - <Testing handler adapter [org.springframework.web.portlet.mvc.SimpleControll
    [email protected]]>
    2005-11-14 16:09:01,580 DEBUG [org.springframework.web.portlet.sample.BooksContro ller] - <Checking and preparing RenderRequest>
    2005-11-14 16:09:01,580 WARN [org.springframework.web.servlet.view.InternalResou rceViewResolver] - <View caching is SWITCHED OFF -- DEVELOPMENT SETTING ONLY: Th
    is can severely impair performance>
    2005-11-14 16:09:01,580 DEBUG [org.springframework.web.portlet.DispatcherPortlet] - <setting contentType to [text/html; charset=ISO-8859-1] from view>
    2005-11-14 16:09:01,630 DEBUG [org.springframework.web.portlet.ViewRendererServle t] - <Successfully completed request>
    2005-11-14 16:09:01,630 DEBUG [ lPortletApplicationContext] - <Publishing event in context [PortletApplicationC
    ontext for namespace 'books-portlet']: RequestHandledEvent: url=[/spring-portlet-sample/WEB-INF/servlet/view]; time=[20ms]; client=[null]; method=[GET]; servlet
    =[ViewRendererServlet]; session=[null]; user=[null]; status=[OK]>
    2005-11-14 16:09:01,630 DEBUG [org.springframework.web.portlet.DispatcherPortlet] - <Successfully completed request>
    2005-11-14 16:09:01,630 DEBUG [ lPortletApplicationContext] - <Publishing event in context [PortletApplicationC
    ontext for namespace 'books-portlet']: RequestHandledEvent: time=[70ms]; portlet=[books]; mode=[view]; type=[render]; session=[B184776A84754541EF82972813F71AC5]
    ; user=[admin]; status=[OK]>

    I've looked at a number of portal specific issues to try and sort this out: VAP for example sticks a security filter into web.xml which can interfere with access to local JSPs - however the problem still occurs when these security filters are removed.

    I know this problem may be specific to VAP, but any thoughts or similar experiences may be useful.


  • #2
    Further confusion...

    I've been running a number of different tests, trying to narrow down the problem.

    One interesting behaviour is that the application behaves in exactly the same way whether the JSP actually exists or not i.e. nothing is rendered and no exceptions thrown when /WEB-INF/jsp/config-view.jsp exists and no exceptions are thrown when the /WEB-INF/jsp/ folder is empty.

    Should the InternalResourceViewResolver behave in this way?


    • #3
      Pretty mysterious problem.

      One thing might be the contentType setting and that your portal doesn't like it.

      Many portals have strange behavior related to the contentType of the RenderResponse. Several will not render unless then contentType is explicitly set. If you do not set the contentType of the RenderResponse, DispatcherPortlet will set it to the contentType of the View (if it is an AbstractView).

      In your Controller, try setting the contentType on either the response or the view to just 'text/html'. If that doesn't work, try setting the contentType on the View to null.

      You might also check with the VAP people to see if they have any known issues with how the RenderResponse needs to be constructed.

      Let me know what you find.



      • #4
        Thanks for the input...

        It turns out that the version of our portal won't fully support the Spring Portlet upgrade is in the works!

        Basically when we were trying to include a JSP....the incorrect context was being used, meaning the JSP couldn't be found.

        Thought that might be of interest.