Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 80350 invoked from network); 2 May 2005 19:37:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 May 2005 19:37:56 -0000 Received: (qmail 986 invoked by uid 500); 2 May 2005 19:38:21 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 627 invoked by uid 500); 2 May 2005 19:38:15 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 541 invoked by uid 99); 2 May 2005 19:38:14 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from chiron.lunarpages.com (HELO chiron.lunarpages.com) (64.235.234.14) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 02 May 2005 12:38:12 -0700 Received: from zammet2 by chiron.lunarpages.com with local (Exim 4.50) id 1DSgiX-0004Cx-HT; Mon, 02 May 2005 12:36:33 -0700 Received: from 12.27.179.239 ([12.27.179.239]) (SquirrelMail authenticated user fzlists@omnytex.com) by webmail.chiron.lunarpages.com with HTTP; Mon, 2 May 2005 15:36:33 -0400 (EDT) Message-ID: <9728.12.27.179.239.1115062593.squirrel@webmail.chiron.lunarpages.com> In-Reply-To: <53242.12.27.179.239.1115062392.squirrel@webmail.chiron.lunarpages.com > References: <1127205156.20050502202842@ukrpost.net> <50632.12.27.179.239.1115055621.squirrel@webmail.chiron.lunarpages.com> <42766ACD.7090304@reumann.net> <35262.12.27.179.239.1115057908.squirrel@webmail.chiron.lunarpages.com> <42767381.2010001@reumann.net> <64728.12.27.179.239.1115059986.squirrel@webmail.chiron.lunarpages.com> <42767D73.3090308@reumann.net> <53242.12.27.179.239.1115062392.squirrel@webmail.chiron.lunarpages.com> Date: Mon, 2 May 2005 15:36:33 -0400 (EDT) Subject: Re: ajax proj From: "Frank W. Zammetti" To: "Struts Users Mailing List" Cc: "Struts Users Mailing List" User-Agent: SquirrelMail/1.4.4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - chiron.lunarpages.com X-AntiAbuse: Original Domain - struts.apache.org X-AntiAbuse: Originator/Caller UID/GID - [32746 1232] / [47 12] X-AntiAbuse: Sender Address Domain - omnytex.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Woops, a couple of typos in there... When I talked about "...all the outputting of HTML would be removed...", I was referring to removing what you see now in the Action. And the first line of that JSP code should read: <% ArrayList sortedPresidentsList = (ArrayList)request.getAttribute("sortedPresidentsList"); -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Mon, May 2, 2005 3:33 pm, Frank W. Zammetti said: > Sure! :) > > Basically view the entire server portion as one piece... at the end of > whatever it is that it does, it's returning HTML (whether it's a complete > page, as usual, or just a snippet, like with Ajax techniques usually). > Whether that HTML is written directly to response in an Action or a JSP > processes (which is writing out to response essentially remember), it's > the same thing. > > The fifth example in my webapp from the article shows this, albeit very > simplistically... the Action just constructs a string from the parameters > submitted, then shoves that string into a request attribute... the then > forwards to a JSP, which basically does nothing but outputs the string and > returns the resultant "page" (the page in this case being nothing but the > string). > > Imagine what the table sorting example would look like with this > approach... all the outputting of HTML would be removed, we would instead > do: > > request.setAttribute("sortedPresidentsList", sortedPresidentsList); > > ...and we'd just do a normal forward to some JSP... in the JSP we might > do: > > <% ArrayListhm = (ArrayList)request.getAttribute("sortedPresidentsList"); > %> > > > > > > > > > <% > for (Iterator it = sortedPresidentsList.iterator(); it.hasNext();) { > HashMap hm = (HashMap)it.next(); > %> > > > > > > > > <% > } > %> >
onMouseOver="style.background='#c0c0c0';" > onMouseOut="style.background='';">First Name onMouseOver="style.background='#c0c0c0';" > onMouseOut="style.background='';">Middle Name onMouseOver="style.background='#c0c0c0';" > onMouseOut="style.background='';">Last Name onClick="retrieveURL('example2RenderTable.do?sortField=firstYearInOffice');" > onMouseOver="style.background='#c0c0c0';" > onMouseOut="style.background='';">First Year In Office onClick="retrieveURL('example2RenderTable.do?sortField=lastYearInOffice');" > onMouseOver="style.background='#c0c0c0';" > onMouseOut="style.background='';">Last Year In Office
<%=(String)hm.get("firstName")%><%=(String)hm.get("middleName")%><%=(String)hm.get("lastName")%><%=(String)hm.get("firstYearInOffice")%><%=(String)hm.get("lastYearInOffice")%>
> > Most people would tend to do with with taglibs, but you get the picture :) > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > > On Mon, May 2, 2005 3:20 pm, Rick Reumann said: >> Frank W. Zammetti wrote the following on 5/2/2005 2:53 PM: >> >>> I think most people would tell you to forward to a JSP to generate what >>> really amounts to just a snippet of HTML... >> >> I'm confused though, you can do that? In other words you can make an >> XMLHttpRequest from one JSP that goes to an Action and in the Action you >> can forward to another JSP to write the response and the original JSP >> that called the XMLHttpRequest somehow pulls this into the innerHTML? >> >> Do you have an example of this? >> >> I'm looking at your table sort and I don't want all the complex display >> and write out of the table to take place in a Java class. I'd like to do >> this in the JSP but not sure how that fits into the Ajax cycle. >> >> >> -- >> Rick >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> For additional commands, e-mail: user-help@struts.apache.org >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org