Return-Path: Delivered-To: apmail-portals-jetspeed-user-archive@www.apache.org Received: (qmail 71050 invoked from network); 6 Jan 2006 17:50:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jan 2006 17:50:56 -0000 Received: (qmail 89609 invoked by uid 500); 6 Jan 2006 17:50:01 -0000 Delivered-To: apmail-portals-jetspeed-user-archive@portals.apache.org Received: (qmail 89590 invoked by uid 500); 6 Jan 2006 17:50:01 -0000 Mailing-List: contact jetspeed-user-help@portals.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jetspeed Users List" Delivered-To: mailing list jetspeed-user@portals.apache.org Received: (qmail 89578 invoked by uid 500); 6 Jan 2006 17:50:01 -0000 Delivered-To: apmail-jakarta-jetspeed-user@jakarta.apache.org Received: (qmail 89575 invoked by uid 99); 6 Jan 2006 17:50:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2006 09:50:01 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jak-jetspeed-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2006 09:50:00 -0800 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Euvhw-0003uT-JT for jetspeed-user@jakarta.apache.org; Fri, 06 Jan 2006 18:48:57 +0100 Received: from CPE000f6636b02a-CM014480016982.cpe.net.cable.rogers.com ([72.139.90.69]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Jan 2006 18:48:56 +0100 Received: from aaronmevans by CPE000f6636b02a-CM014480016982.cpe.net.cable.rogers.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Jan 2006 18:48:56 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: jetspeed-user@jakarta.apache.org From: Aaron Evans Subject: Re: JSP Stand-alone portlet help Date: Fri, 6 Jan 2006 17:48:51 +0000 (UTC) Lines: 78 Message-ID: References: <005e01c612e7$57f49570$7703a8c0@advocare.com> <200601061739.k06Hd4r24649@sunlist.sdrc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 72.139.90.69 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7) Sender: news X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Scott T Weaver binary-designs.net> writes: > > Well you can't just point to a jsp. You need to write at least one portlet > then have it include the relevant jsp using > PortletRequestDispatcher.include(). Direct rendering of jsp pages is not > supported in the portlet spec as it is in the servlet spec. > > -Scott > Scott is quite right. Let's be clear here: You have stand-alone JSPs, not stand-alone JSP portlets. No modern containers even support deploying just JSPs to a doc root anyway, they always must be part of a web-application. What you need to do is add them to a web-application that is also a portlet application as per the tutorial. Here is a very simple portlet that you can re-use for all your JSPs: ********** CODE BEGIN *********** package com.mycompany.portlet; import java.io.IOException; import javax.portlet.GenericPortlet; import javax.portlet.PortletConfig; import javax.portlet.PortletContext; import javax.portlet.PortletException; import javax.portlet.PortletRequestDispatcher; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; public class SimpleContentPortlet extends GenericPortlet { private String viewPage="view.jsp"; public void init(PortletConfig config) throws PortletException { if(config.getInitParameter("ViewPage")!=null) { this.viewPage = config.getInitParameter("ViewPage"); } super.init(config); } public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { PortletContext context = getPortletContext(); PortletRequestDispatcher rd = context.getRequestDispatcher(this.viewPage); rd.include(request, response); } } ********** CODE END *********** By default, this will attempt to include a jsp named view.jsp in the root of your web-app. So, in your portlet.xml, use an init param to specify a 'ViewPage' param and set it to the relative path of one of your JSPs (relative that is to the root of your web app directory). Note that only view is supported here, but doing the same thing for edit and help is trivial. So, for each of your JSPs, add a distinct portlet definition in your portlet.xml with a distinct name. For the portlet class, you would use com.mycompany.portlet.SimpleContentPortlet. Then just add to PSML as described above. --------------------------------------------------------------------- To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org For additional commands, e-mail: jetspeed-user-help@portals.apache.org