Return-Path: Delivered-To: apmail-portals-jetspeed-user-archive@www.apache.org Received: (qmail 11102 invoked from network); 18 Apr 2008 19:50:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Apr 2008 19:50:43 -0000 Received: (qmail 83028 invoked by uid 500); 18 Apr 2008 19:50:33 -0000 Delivered-To: apmail-portals-jetspeed-user-archive@portals.apache.org Received: (qmail 83009 invoked by uid 500); 18 Apr 2008 19:50:33 -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 82996 invoked by uid 99); 18 Apr 2008 19:50:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2008 12:50:33 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of danrolsen@utah.gov designates 168.180.96.58 as permitted sender) Received: from [168.180.96.58] (HELO gwia2.state.ut.us) (168.180.96.58) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2008 19:49:41 +0000 Received: from STATE-GWIA2-MTA by gwia2.state.ut.us with Novell_GroupWise; Fri, 18 Apr 2008 13:49:59 -0600 Message-Id: <4808A6FB.E2C5.0058.0@utah.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.2 HP Date: Fri, 18 Apr 2008 13:49:48 -0600 From: "Dan Olsen" To: "Jetspeed Users List" Subject: Re: Portlets with Forms and Communication with a database References: <4808A3C9.E2C5.0058.0@utah.gov> <94cd6be60804181244y6504f285u105b23d5042ecce6@mail.gmail.com> In-Reply-To: <94cd6be60804181244y6504f285u105b23d5042ecce6@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__Part9FB6D24C.0__=" X-GWPos: 16810618-16810762 X-Virus-Checked: Checked by ClamAV on apache.org --=__Part9FB6D24C.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable How about when talking to the database? All the portlets will be talking = to the same database and I don't want to have to change all the portlets = code to point to the new production database. Is there a way I can define = the database properties and use that and make it so I only have to update = the database information in one place? Something like a preferences = file?=20 =20 I'm new to Java web programming so I'm not sure how this is all done. I = know with PHP I could just have a config file where I can read the = information from. I'd like to do something like that in Java with my = portlets. >>> "Andrew Strickland" 4/18/2008 1:44 PM >>> Don't have time to post examples but... Using a form on the edit page shouldn't be any different than using a form on the view or help page. I've done it and there's really nothing exceptional. Just handle the form submission in your portlet's processAction method. You can put a hidden input into your form with a name like "action" and give it a value of "edit" or "save" so that you can differentiate between which portlet page the submission is coming from. There might be better ways to do that but this way is easy and simple. The way I use the edit page is as the page that can modify the portlet preferences. So any form submission from the edit page is a change to a preference which the portlet then makes use of Jetspeed's preference database to store. On Fri, Apr 18, 2008 at 3:36 PM, Dan Olsen wrote: > Does anyone know of any example portlets that use forms in the Edit = window state and the new information from the form is then stored in a = database? I need to do this for my project and I'm looking for some best = practices on how to do this. > > - Dan > --------------------------------------------------------------------- To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org=20 For additional commands, e-mail: jetspeed-user-help@portals.apache.org=20 --=__Part9FB6D24C.0__=--