Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8391533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:17:18+00:00 2026-06-09T19:17:18+00:00

I am developing a custom portlet (EDIT:I’m extending MVCPortlet), and looking at several examples

  • 0

I am developing a custom portlet (EDIT:I’m extending MVCPortlet), and looking at several examples and tutorials, I find that when the doView(RenderRequest, RenderResponse) method is overridden, at the end of it there is always at least this line:

super.doView(renderRequest, renderResponse);

or this:

include(viewJSP, renderRequest, renderResponse);

If I don’t put either of these my portlet doesn’t render anything, but any of them does the trick.

I would like to know which one I should be using, and why do I need to add them to get my portlet to work.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:17:19+00:00Added an answer on June 9, 2026 at 7:17 pm

    So you must be extending MVCPortlet class. Both the calls are used to include the JSP after the doView processing is completed. If you look at the source code of this class then you would understand what the flow is, below is my explanation:

    super.doView(renderRequest, renderResponse);

    This includes the default JSP i.e. view.jsp, that you might (or not) have configured in portlet.xml something like this:

    <init-param>
        <name>view-template</name>
        <value>/html/view.jsp</value>
    </init-param>
    

    This super class method does nothing but calls the include(viewJSP, renderRequest, renderResponse); method at the end.

    include(viewJSP, renderRequest, renderResponse);

    This method includes whatever JSP path you have specified for the parameter viewJSP. So with this call you can specify including different JSP for different condition something like the following:

    if (isThisTrue) {
        include("/html/myCustomPortlet/view.jsp", renderRequest, renderResponse);
    } else if (isThisTrueThen) {
        include("/html/myCustomPortlet/first/another_view.jsp", renderRequest, renderResponse);
    } else {
        super.doView(renderRequest, renderResponse);
    }
    

    So depending on your requirement you can use any to the two or the mix of the two as shown above. Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a standalone custom registry, custom login portlet, and custom profile portlet for
Say you're developing a custom control and there's a key template part that your
I'm developing custom client/server application that requires client to log in with their username
I am developing custom iPad applications for clients. So far I know that you
I'm developing a custom control that doesn't inherit from Button. I want to implement
I'm developing a custom UIViewController for iPhone that emulates a subset of the MPMediaPickerController
I am developing an application which utilizes a custom network protocol over TCP. Several
Does anyone have any good links for developing custom field and content types that
I'm currently developing a custom control and realize that my code is being run
We are developing a custom textual DSL, that will ultimately get integrated into Visual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.