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

  • Home
  • SEARCH
  • 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 364379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:25:57+00:00 2026-05-12T13:25:57+00:00

I am curious if anyone knows if it is possible for a single portlet

  • 0

I am curious if anyone knows if it is possible for a single portlet to contain multiple pages, let’s say JSP pages. Furthermore is it possible to link to these different pages within the same portlet?

For example. Let’s say I have a single portlet. And in this portlet I want the initial view to be a JSP page with just 5 links on it to 5 different JSP pages. And when a user clicked on one of these 5 links, it would load the appropriate JSP page into the portlet.

The end goal would basically be a little mini website all contained inside a portlet.

Now, I understand that this might not be the best use of a portlet, but for the sake of a project I am working on, I still would like to know if it is possible.

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-05-12T13:25:58+00:00Added an answer on May 12, 2026 at 1:25 pm

    Sure, a portlet can contain more than one JSP.

    You can display any JSP you want via the PortletRequestDispatcher in your doView (or doHelp or doEdit) method:

    protected void doView(RenderRequest req, RenderResponse resp)
           throws PortletException, IOException, UnavailableException {
       resp.setContentType("text/html"); 
       String myview = req.getParameter("myview");
       String view = "/WEB-INF/jsp/" + (myview==null ? "bar" : myview) + ".jsp";
       PortletRequestDispatcher dispatcher = 
                                     getPortletContext().getRequestDispatcher(view);
       dispatcher.include(req, resp);
    }
    

    You could use a parameter to set the view. In the JSP with the links, you’d need to use the Portlet API to create/encode the links to the Portlet. For example:

    <portlet:renderURL>
      <portlet:param name="myview" value="foo"/>
    </portlet:renderURL>
    

    (I haven’t really kept abreast of JSR286/Portlet 2.0 – this stuff should work with JSR168/Portlet 1.0 – so it is worth checking the new API if you’re using it.)

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

Sidebar

Related Questions

I'm curious if anyone knows of any downloadable Objective C sample code for the
I'm curious if anyone knows of a way to easily get a double border
I was curious if anyone knows of any good examples of plugins that I
Just curious if anyone knows of good sites for learning and understanding PyGame. I've
I'm curious if anyone knows how I can save the current state of a
I'm curious if anyone knows how to move the global messages inside the content
I'm curious if anyone knows of any frameworks that enable asynchronous multiplayer gaming in
I'm curious if anyone out there knows of something perhaps like Akismet, but where
Just curious if anyone knows a quick way to use ucwords() on a string
Quick one: I'm curious if anyone knows of certain circumstances under which $_SERVER['REQUEST_URI'] would

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.