You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sergey Livanov <Se...@ukrpost.net> on 2005/05/02 19:28:42 UTC

ajax proj

Frank,
Where can I find ajaxsample.war ?


-- 
С уважением,
 Sergey                          mailto:Sergey.Livanov@ukrpost.net


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Feel free, link away!

If you like that, I suggest taking a peak at the ajaxtags... it's even
better when you don't have to write the code yourself, just throw an entry
in a config file :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, May 2, 2005 2:27 pm, Rick Reumann said:
> Frank W. Zammetti wrote the following on 5/2/2005 2:18 PM:
>> Glad your enjoying it Rick!  I hope you find something useful in it too.
>> :)
>>
>
> I like learning from examples and your examples ARE AWESOME!!!!!!!!
>
> If you don't mind, I'm going to link your article from Struttin With
> Struts http://www.reumann.net/struts/main.do
>
> I'm so excited there is finally a clean way to populate drop down lists
> when an onChange is fired from the other list or a nice table sort.
>
> This stuff is just great. Wish I wasn't so late in getting into it.
>
> --
> 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


Re: ajax proj

Posted by Rick Reumann <st...@reumann.net>.
Frank W. Zammetti wrote the following on 5/2/2005 2:18 PM:
> Glad your enjoying it Rick!  I hope you find something useful in it too. :)
> 

I like learning from examples and your examples ARE AWESOME!!!!!!!!

If you don't mind, I'm going to link your article from Struttin With 
Struts http://www.reumann.net/struts/main.do

I'm so excited there is finally a clean way to populate drop down lists 
when an onChange is fired from the other list or a nice table sort.

This stuff is just great. Wish I wasn't so late in getting into it.

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by Rick Reumann <st...@reumann.net>.
Frank W. Zammetti wrote the following on 5/2/2005 3:33 PM:

> The fifth example in my webapp from the article shows this, 

Perfect thanks. I should have looked at all of these before posting:)

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
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");
> %>
> <table border="1" align="center" cellpadding="2" cellspacing="0">
> <tr>
> <th onClick="retrieveURL('example2RenderTable.do?sortField=firstName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">First Name</th>
> <th onClick="retrieveURL('example2RenderTable.do?sortField=middleName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Middle Name</th>
> <th onClick="retrieveURL('example2RenderTable.do?sortField=lastName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Last Name</th>
> <th
> onClick="retrieveURL('example2RenderTable.do?sortField=firstYearInOffice');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">First Year In Office</th>
> <th
> onClick="retrieveURL('example2RenderTable.do?sortField=lastYearInOffice');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Last Year In Office</th>
> </tr>
> <%
> for (Iterator it = sortedPresidentsList.iterator(); it.hasNext();) {
>   HashMap hm = (HashMap)it.next();
> %>
>   <tr>
>   <td><%=(String)hm.get("firstName")%></td>
>   <td><%=(String)hm.get("middleName")%></td>
>   <td><%=(String)hm.get("lastName")%></td>
>   <td><%=(String)hm.get("firstYearInOffice")%></td>
>   <td><%=(String)hm.get("lastYearInOffice")%></td>
>   </tr>
> <%
> }
> %>
> </table>
>
> 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


RE: Struts 1.3 & custom controller

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Yep, that's exactly what you should be able to do.  And if you decide to
go off and do it, do feel free to feed it back to me for release on the
strusws SF project :)

Here's some links to get you started:

http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains.html
http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains2.html

Your really looking at Commons Chain, which forms the basis of 1.3.  As I
said, I haven't toyed with 1.3 much, so in terms of how this really
applies to 1.3 in detail I don't know of any link to help there.  Maybe
one of the struts team members can direct you...

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Tue, May 3, 2005 10:24 am, Marco Mistroni said:
> Hello Frank,
> 	If  Str1.3 RP is implemented as set of commands, then shouldn't
> I be able to extend It to add my own commands (such as one that does the
> trick
> In your request processor)..
>
> I think it should be possible.... at least I would like to support J2ME
> clients (via strutsws), HTML clients and WML clients for my
> application..
>
> So I could define a RP which contains set of commands for handling
> request depending on the user agent..
>
> I need just some docs for Struts 1.3 Request Processor.......
>
> Any good links (other than sourcecode)?
>
> Thanx in advance and regards
> 	Marco
>
>
> -----Original Message-----
> From: Frank W. Zammetti [mailto:fzlists@omnytex.com]
> Sent: 03 May 2005 14:40
> To: Marco Mistroni
> Cc: 'Struts Users Mailing List'
> Subject: Re: Struts 1.3 & custom controller
>
> Hi Marco,
>
> You are correct, the custom controller is at the heart of strutsws.
>
> I hesitate to answer about 1.3 because I've only looked at it very
> briefly.  But, I'll try and answer and if someone more knowledgable sees
> me flub something, please correct me...
>
> Remember that 1.3 uses the CoR pattern to break down the request
> processor
> into a chain of functions.  It is designed to be functionally equivalent
> to the "current" request processor, but defined as a chain of Commands.
>
> I seem to recall a thread at one point that said you still could in fact
> use a custom monolithic processor... if that's not true than the bottom
> line is simply that no, strutsws as it exists today will not be usable
> with 1.3.
>
> Let's assume however that I am remembering correctly and you CAN do
> that... you'd still be inserting the 1.1 RP into the mix, which I'd bet
> isn't what you really want to do.  It is also worth noting that I never
> did a strutsws version for the Tiles processor, so Tiles and strutsws
> don't mix at this point.  This hasn't been a big problem for most people
> apparently (I guess they just set up a separate module for the web
> services, I don't really know)...
>
> ...which does kind of raise an interesting question... assuming you can
> use a non-chain RP in 1.3, it might be possible to just use the 1.1 RP
> in
> a module for your web services.  If it's a module expressly for strutsws
> functions, which RP you use might not matter as much (I could be wrong
> though... there could have been some changes between 1.1 and 1.3 that
> makes it not work, I frankly don't know).  I've never tied such a setup,
> so I have no idea if it'll actually work.
>
> Lastly, I do have the intention of updating strutsws specifically for
> 1.3
> (it should be a piece of cake to insert a command or two into the chain
> to
> perform the necessary functions), but I won't do that until 1.3 is a GA
> release.  I actualy thought I wrote it against 1.2.4, I didn't realize
> it
> was 1.1, so the first chance I get I will update it for 1.2.4 at
> least...
> I only intend to support GA releases for strutsws as well as ajaxtags by
> the way.
>
> Hope that helps!
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
>
> On Tue, May 3, 2005 4:26 am, Marco Mistroni said:
>> Hello all,
>> 	I have downloaded strutsws by Frank Zammetti, which
>> Enables struts app to be exposed as a webservice..
>> It uses a custom controller(pls frank correct me if I m wrong) that
>> Detects if request is an XML request...customizing then output so that
>> it
>> Will be an XML response that matches form data.
>>
>> Application works fine with Struts 1.1.. I have just written a
>> <controller>
>> Tag in struts-config and a  plugin used by strutsws.
>>
>> I found problems however with Struts 1.3, and I was wondering if, in
>> Struts 1.3, was enough to define a  <controller> tag in
>> struts-config.xml
>> Or something else was needed..
>>
>>
>> Thanx in advance and regards
>> 	Marco
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> 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


RE: Struts 1.3 & custom controller

Posted by Marco Mistroni <mm...@waersystems.com>.
Hello all,
	I have an app that was using  strutsws from Frank Zammetti, and
I am trying to port it to Struts 1.3..
The current version of strutsws override Struts's result processor, and
in particular it overrides those following methods:
- processPreprocess
- processValidate
- processActionPerform
- processMapping
- processException

I had a look at Struts 1.3 core, and how chain &
ComposableRequestProcessor
Are used instead of old request processor, and in evaluating what to
write, which class to extend and wht changes to do I got a littlebit
stuck...

So far, I got to this conclusions, and I was wondering if someone can
check
Them as well as help me in some points

- preprocess().: this does some logic depending on request, eventually
modifying the path in order to append additional parameters... so I
thought
to extend org.apache.struts.chain.command.servlet.PerformForward 

- processValidate: in the method, code needs to validate a SOAPRequest,
so I thought to extend
org.apache.struts.chain.command.servlet.ValidateActionForm

- processActionPerform(): this metod was supposed to redirect to a
custom page after action has done its job and, so I thought that I need
to extend
org.apache.struts.chain.command.servlet.SelectForward


- processMapping(): ?. I really don't know which class to extend / write
for this... below are the javadoc comments.. I was not able to identify
similar
functionality in commands of Struts 1.3.. anyone can help?

/**
 * This method will override the processMapping() method in the base
 * RequestProcessor class.  When we service a Web Service request, we
will
be
 * overriding the input that might be specified in the ActionMapping so
that
* we can properly handle form validation failures.  Problem is, since
the
 * ActionMapping returned by the super version of this method is shared
by
 * all requests, anything that we might alter could impact them all.
For
 * instance, if a Web Service request comes in, it would work fine
without
 * this, but if a regular request comes in for the same action next time
 * and a validation failure occurs, the input page will be an XML
response,
 * which would of course be wrong.  So, here we will determine if we are
 * servicing a Web Service request or not, and if we are we'll return a
 * clone of the mapping, otherwise we'll return the real mapping that
the
 * call to the super version gives us.



- processException(): here I suppose I need to extend
org.apache.struts.chain.command.servlet.ExceptionHandler....


Frank, you might be able to provide more clarifications or correct me if
I was wrong in my explanations.....  I had a look yesterday at
WSRequestProcessor after 3 days on holiday in sunshine.... maybe my
brain boiled a little bit in the sun :-)


Thanx in advance and regards
	marco







---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 1.3, chain & command configuration / few thoughts..

Posted by Joe Germuska <Jo...@Germuska.com>.
At 12:00 PM +0100 5/4/05, Marco Mistroni wrote:
>Hello joe,
>>So really, all you should need to do is write a custom subclass of
>>ComposableRequestProcessor which gets its base CatalogFactory from
>>Spring during the init method.   Then, you'd have to adapt the
>>default chain-config.xml into Spring's bean-factory XML syntax so as
>>to create a CatalogFactory and register the "struts" catalog all in
>>Spring.
>
>That's true... but spring & appContext are initialized only after
>The spring plugIn has been initialized, and I was wondering, are
>plugIn initialized AFTER ComposableRequestProcessor?
>Because, if it is so, then I am out of business :-)

Ah, yeah.  I've been using the ContextLoaderListener instead.

The other thing you could do in your RequestProcessor is lazily look 
up the CatalogFactory.  If you made sure that the instantiation in 
Spring was not lazy and was not a singleton then I guess you could 
retrieve it from the ApplicationContext on each request with no big 
issues.

It's possible that I still didn't quite get the 
ComposableRequestProcessor right for that kind of use case -- I'd 
have to look -- but I think you can still get there...

Joe



>
>Regards
>	marco
>
>
>
>
>
>
>
>
>
>Joe
>
>
>
>At 10:48 AM +0100 5/4/05, Marco Mistroni wrote:
>>Hello all,
>>	I am currently using Struts 1.3dev in my application, and I have
>>recently bothered the list to find a way to configure commands via
>>Spring.
>>Now, just yesterday, I came across an article
>>(http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains2.html)
>>on how The new RequestProcessor is used in Struts 1.3...
>>Struts 1.3 uses a chain-config.xml and custom chan configs that allows
>>user
>>To 'override' or change the behaviour of request processor.
>>
>>Following that article I have implemented my custom command for
>>pre-processing in RequestProcessor (as showed in article).
>>
>>Question is: what if I want to use some of my spring beans in one of
>>those
>>'request processor' commands?
>>
>>Currently, in my app, I am using commands for doing various logic, and
>>those
>>Commands are configured via Spring by using a Spring plugin..
>>
>>But I am not sure I can do same with RequestProcessor commands, since
>>the chain-config.xml file is read at initialization time, when I
>suppose
>>the Spring plugin has not been initialized yet... so the bean won't be
>>available..
>>
>>If I remember correct, there's a way in Spring to say that a 'bean'
>will
>>be initialized only after  'beanx' has been initialized (I guess is a
>>'depend' attribute ein applicationContext.xml)..
>>
>>But will this work for RequestProcessor commands?
>>
>>Hope I was clear enough to explain my problem...
>>
>>Thanx in advance and regars
>>	marco
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>
>
>--
>Joe Germuska           
>Joe@Germuska.com 
>http://blog.germuska.com   
>"Narrow minds are weapons made for mass destruction"  -The Ex
>
>---------------------------------------------------------------------
>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


-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 1.3, chain & command configuration / few thoughts..

Posted by Marco Mistroni <mm...@waersystems.com>.
Hello joe,
>So really, all you should need to do is write a custom subclass of 
>ComposableRequestProcessor which gets its base CatalogFactory from 
>Spring during the init method.   Then, you'd have to adapt the 
>default chain-config.xml into Spring's bean-factory XML syntax so as 
>to create a CatalogFactory and register the "struts" catalog all in 
>Spring.

That's true... but spring & appContext are initialized only after
The spring plugIn has been initialized, and I was wondering, are 
plugIn initialized AFTER ComposableRequestProcessor? 
Because, if it is so, then I am out of business :-)


Regards
	marco









Joe



At 10:48 AM +0100 5/4/05, Marco Mistroni wrote:
>Hello all,
>	I am currently using Struts 1.3dev in my application, and I have
>recently bothered the list to find a way to configure commands via
>Spring.
>Now, just yesterday, I came across an article
>(http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains2.html)
>on how The new RequestProcessor is used in Struts 1.3...
>Struts 1.3 uses a chain-config.xml and custom chan configs that allows
>user
>To 'override' or change the behaviour of request processor.
>
>Following that article I have implemented my custom command for
>pre-processing in RequestProcessor (as showed in article).
>
>Question is: what if I want to use some of my spring beans in one of
>those
>'request processor' commands?
>
>Currently, in my app, I am using commands for doing various logic, and
>those
>Commands are configured via Spring by using a Spring plugin..
>
>But I am not sure I can do same with RequestProcessor commands, since
>the chain-config.xml file is read at initialization time, when I
suppose
>the Spring plugin has not been initialized yet... so the bean won't be
>available..
>
>If I remember correct, there's a way in Spring to say that a 'bean'
will
>be initialized only after  'beanx' has been initialized (I guess is a
>'depend' attribute ein applicationContext.xml)..
>
>But will this work for RequestProcessor commands?
>
>Hope I was clear enough to explain my problem...
>
>Thanx in advance and regars
>	marco
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org


-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
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


Re: Struts 1.3, chain & command configuration / few thoughts..

Posted by Joe Germuska <Jo...@Germuska.com>.
Hi, Marco:

Since you first brought up using Spring to configure the chain, that 
has been on the back of my mind.  Probably like you, as I use Spring 
more in an application I find it frustrating to bump up against 
places where I can't seem to connect to the ApplicationContext or 
otherwise use Spring's DI services.

I haven't needed what you describe yet, but I've been thinking about 
it.  I've made a few changes both to commons-chain and Struts and I 
think the path is now clear, although you'll still have to write some 
code.

Last week I committed changes to commons-chain LookupCommand and the 
base Struts RequestProcessor which expose the CatalogFactory as a 
settable property.  This gets around the fundamental problem of 
having them always go to the static CatalogFactory instance managed 
by the CatalogFactory class.  Now you can have both of them use a CF 
created by Spring.

So really, all you should need to do is write a custom subclass of 
ComposableRequestProcessor which gets its base CatalogFactory from 
Spring during the init method.   Then, you'd have to adapt the 
default chain-config.xml into Spring's bean-factory XML syntax so as 
to create a CatalogFactory and register the "struts" catalog all in 
Spring.

Until/unless Struts actually has a dependency upon Spring, I'm not 
sure that we can do much more in the core library itself.  But I 
think you can get there if you want to.

Joe



At 10:48 AM +0100 5/4/05, Marco Mistroni wrote:
>Hello all,
>	I am currently using Struts 1.3dev in my application, and I have
>recently bothered the list to find a way to configure commands via
>Spring.
>Now, just yesterday, I came across an article
>(http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains2.html)
>on how The new RequestProcessor is used in Struts 1.3...
>Struts 1.3 uses a chain-config.xml and custom chan configs that allows
>user
>To 'override' or change the behaviour of request processor.
>
>Following that article I have implemented my custom command for
>pre-processing in RequestProcessor (as showed in article).
>
>Question is: what if I want to use some of my spring beans in one of
>those
>'request processor' commands?
>
>Currently, in my app, I am using commands for doing various logic, and
>those
>Commands are configured via Spring by using a Spring plugin..
>
>But I am not sure I can do same with RequestProcessor commands, since
>the chain-config.xml file is read at initialization time, when I suppose
>the Spring plugin has not been initialized yet... so the bean won't be
>available..
>
>If I remember correct, there's a way in Spring to say that a 'bean' will
>be initialized only after  'beanx' has been initialized (I guess is a
>'depend' attribute ein applicationContext.xml)..
>
>But will this work for RequestProcessor commands?
>
>Hope I was clear enough to explain my problem...
>
>Thanx in advance and regars
>	marco
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org


-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Struts 1.3, chain & command configuration / few thoughts..

Posted by Marco Mistroni <mm...@waersystems.com>.
Hello all,
	I am currently using Struts 1.3dev in my application, and I have
recently bothered the list to find a way to configure commands via
Spring.
Now, just yesterday, I came across an article
(http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains2.html)
on how The new RequestProcessor is used in Struts 1.3...
Struts 1.3 uses a chain-config.xml and custom chan configs that allows
user
To 'override' or change the behaviour of request processor.

Following that article I have implemented my custom command for
pre-processing in RequestProcessor (as showed in article).

Question is: what if I want to use some of my spring beans in one of
those
'request processor' commands?

Currently, in my app, I am using commands for doing various logic, and
those
Commands are configured via Spring by using a Spring plugin..

But I am not sure I can do same with RequestProcessor commands, since
the chain-config.xml file is read at initialization time, when I suppose
the Spring plugin has not been initialized yet... so the bean won't be
available..

If I remember correct, there's a way in Spring to say that a 'bean' will
be initialized only after  'beanx' has been initialized (I guess is a
'depend' attribute ein applicationContext.xml)..

But will this work for RequestProcessor commands?

Hope I was clear enough to explain my problem...

Thanx in advance and regars
	marco


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 1.3 & custom controller

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
I'm going to try and find some time next week to do strutsws in 1.3... as
much for my own learning as for anyone else, but I think that might be a
good thing to post about on the Wiki, a real-life example step-by-step. 
Even those that have never looked at strutsws may find the walk-through
helpful.

I'm taking the family on vacation tomorrow though and won't be back until
Monday, so I won't get to it before late next week at best.  Don't hold
out for it Marco :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Tue, May 3, 2005 11:22 am, Joe Germuska said:
> At 3:24 PM +0100 5/3/05, Marco Mistroni wrote:
>>Hello Frank,
>>	If  Str1.3 RP is implemented as set of commands, then shouldn't
>>I be able to extend It to add my own commands (such as one that does the
>>trick
>>In your request processor)..
>>
>>I think it should be possible.... at least I would like to support J2ME
>>clients (via strutsws), HTML clients and WML clients for my
>>application..
>>
>>So I could define a RP which contains set of commands for handling
>>request depending on the user agent..
>>
>>I need just some docs for Struts 1.3 Request Processor.......
>>
>>Any good links (other than sourcecode)?
>
> I suppose not.  This is something we need to do, and something which
> will be easier to do based on feedback from newcomers who don't know
> it so well.  (To be honest, it will be rather a while before I have
> time to write docs for the ComposableRequestProcessor, although if
> someone else wrote some stuff, I might have some time to review it.)
>
> Really, as I think about your question, it's hard for me to know
> where to start, since it seems so obvious to me ;-)  But then, I have
> been using struts-chain to back a webapp for more than a year now.
>
> But the questions you've been asking on the list have been helpful,
> and if you feel like you can boil any of your learning down, maybe
> you can find a spot in the Wiki to start gathering some notes?
>
> Joe
>
> --
> Joe Germuska
> Joe@Germuska.com
> http://blog.germuska.com
> "Narrow minds are weapons made for mass destruction"  -The Ex
>
> ---------------------------------------------------------------------
> 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


RE: Struts 1.3 & custom controller

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
I think that's exactly what the guys are looking for at this point... if
you had any issues whatsoever with that port, posting about them I think
would be most welcome.

Ironic... if you say that everything went perfect that's almost less
helpful, isn't it?? :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Tue, May 3, 2005 11:32 am, Marco Mistroni said:
> Hello all ,
> 	In the meantime I found an interesting article from Bill
> Siggelkow
>
> http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains2.html
>
>
> it explains something about RequestProcessor..
>
> I'll try to build up something and see if I can get something basic
> To work, then I guess I'll be back asking questions :-)
>
> Regards
> 	Marco
>
> PS I have also been 'porting' my old app (written using Struts 1.1) to
> Struts 1.3/chain..it works just great :-)
>
>
>
> -----Original Message-----
> From: Joe Germuska [mailto:Joe@germuska.com]
> Sent: 03 May 2005 16:23
> To: Marco Mistroni; 'Struts Users Mailing List'
> Subject: RE: Struts 1.3 & custom controller
>
> At 3:24 PM +0100 5/3/05, Marco Mistroni wrote:
>>Hello Frank,
>>	If  Str1.3 RP is implemented as set of commands, then shouldn't
>>I be able to extend It to add my own commands (such as one that does
> the
>>trick
>>In your request processor)..
>>
>>I think it should be possible.... at least I would like to support J2ME
>>clients (via strutsws), HTML clients and WML clients for my
>>application..
>>
>>So I could define a RP which contains set of commands for handling
>>request depending on the user agent..
>>
>>I need just some docs for Struts 1.3 Request Processor.......
>>
>>Any good links (other than sourcecode)?
>
> I suppose not.  This is something we need to do, and something which
> will be easier to do based on feedback from newcomers who don't know
> it so well.  (To be honest, it will be rather a while before I have
> time to write docs for the ComposableRequestProcessor, although if
> someone else wrote some stuff, I might have some time to review it.)
>
> Really, as I think about your question, it's hard for me to know
> where to start, since it seems so obvious to me ;-)  But then, I have
> been using struts-chain to back a webapp for more than a year now.
>
> But the questions you've been asking on the list have been helpful,
> and if you feel like you can boil any of your learning down, maybe
> you can find a spot in the Wiki to start gathering some notes?
>
> Joe
>
> --
> Joe Germuska
> Joe@Germuska.com
> http://blog.germuska.com
> "Narrow minds are weapons made for mass destruction"  -The Ex
>
>
> ---------------------------------------------------------------------
> 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


RE: Struts 1.3 & custom controller

Posted by Marco Mistroni <mm...@waersystems.com>.
Hello all ,
	In the meantime I found an interesting article from Bill
Siggelkow

http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains2.html


it explains something about RequestProcessor..

I'll try to build up something and see if I can get something basic
To work, then I guess I'll be back asking questions :-)

Regards
	Marco

PS I have also been 'porting' my old app (written using Struts 1.1) to
Struts 1.3/chain..it works just great :-) 

 

-----Original Message-----
From: Joe Germuska [mailto:Joe@germuska.com] 
Sent: 03 May 2005 16:23
To: Marco Mistroni; 'Struts Users Mailing List'
Subject: RE: Struts 1.3 & custom controller

At 3:24 PM +0100 5/3/05, Marco Mistroni wrote:
>Hello Frank,
>	If  Str1.3 RP is implemented as set of commands, then shouldn't
>I be able to extend It to add my own commands (such as one that does
the
>trick
>In your request processor)..
>
>I think it should be possible.... at least I would like to support J2ME
>clients (via strutsws), HTML clients and WML clients for my
>application..
>
>So I could define a RP which contains set of commands for handling
>request depending on the user agent..
>
>I need just some docs for Struts 1.3 Request Processor.......
>
>Any good links (other than sourcecode)?

I suppose not.  This is something we need to do, and something which 
will be easier to do based on feedback from newcomers who don't know 
it so well.  (To be honest, it will be rather a while before I have 
time to write docs for the ComposableRequestProcessor, although if 
someone else wrote some stuff, I might have some time to review it.)

Really, as I think about your question, it's hard for me to know 
where to start, since it seems so obvious to me ;-)  But then, I have 
been using struts-chain to back a webapp for more than a year now.

But the questions you've been asking on the list have been helpful, 
and if you feel like you can boil any of your learning down, maybe 
you can find a spot in the Wiki to start gathering some notes?

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 1.3 & custom controller

Posted by Joe Germuska <Jo...@Germuska.com>.
At 3:24 PM +0100 5/3/05, Marco Mistroni wrote:
>Hello Frank,
>	If  Str1.3 RP is implemented as set of commands, then shouldn't
>I be able to extend It to add my own commands (such as one that does the
>trick
>In your request processor)..
>
>I think it should be possible.... at least I would like to support J2ME
>clients (via strutsws), HTML clients and WML clients for my
>application..
>
>So I could define a RP which contains set of commands for handling
>request depending on the user agent..
>
>I need just some docs for Struts 1.3 Request Processor.......
>
>Any good links (other than sourcecode)?

I suppose not.  This is something we need to do, and something which 
will be easier to do based on feedback from newcomers who don't know 
it so well.  (To be honest, it will be rather a while before I have 
time to write docs for the ComposableRequestProcessor, although if 
someone else wrote some stuff, I might have some time to review it.)

Really, as I think about your question, it's hard for me to know 
where to start, since it seems so obvious to me ;-)  But then, I have 
been using struts-chain to back a webapp for more than a year now.

But the questions you've been asking on the list have been helpful, 
and if you feel like you can boil any of your learning down, maybe 
you can find a spot in the Wiki to start gathering some notes?

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 1.3 & custom controller

Posted by Marco Mistroni <mm...@waersystems.com>.
Hello Frank,
	If  Str1.3 RP is implemented as set of commands, then shouldn't
I be able to extend It to add my own commands (such as one that does the
trick
In your request processor)..

I think it should be possible.... at least I would like to support J2ME
clients (via strutsws), HTML clients and WML clients for my
application..

So I could define a RP which contains set of commands for handling
request depending on the user agent..

I need just some docs for Struts 1.3 Request Processor....... 

Any good links (other than sourcecode)?

Thanx in advance and regards
	Marco


-----Original Message-----
From: Frank W. Zammetti [mailto:fzlists@omnytex.com] 
Sent: 03 May 2005 14:40
To: Marco Mistroni
Cc: 'Struts Users Mailing List'
Subject: Re: Struts 1.3 & custom controller

Hi Marco,

You are correct, the custom controller is at the heart of strutsws.

I hesitate to answer about 1.3 because I've only looked at it very
briefly.  But, I'll try and answer and if someone more knowledgable sees
me flub something, please correct me...

Remember that 1.3 uses the CoR pattern to break down the request
processor
into a chain of functions.  It is designed to be functionally equivalent
to the "current" request processor, but defined as a chain of Commands.

I seem to recall a thread at one point that said you still could in fact
use a custom monolithic processor... if that's not true than the bottom
line is simply that no, strutsws as it exists today will not be usable
with 1.3.

Let's assume however that I am remembering correctly and you CAN do
that... you'd still be inserting the 1.1 RP into the mix, which I'd bet
isn't what you really want to do.  It is also worth noting that I never
did a strutsws version for the Tiles processor, so Tiles and strutsws
don't mix at this point.  This hasn't been a big problem for most people
apparently (I guess they just set up a separate module for the web
services, I don't really know)...

...which does kind of raise an interesting question... assuming you can
use a non-chain RP in 1.3, it might be possible to just use the 1.1 RP
in
a module for your web services.  If it's a module expressly for strutsws
functions, which RP you use might not matter as much (I could be wrong
though... there could have been some changes between 1.1 and 1.3 that
makes it not work, I frankly don't know).  I've never tied such a setup,
so I have no idea if it'll actually work.

Lastly, I do have the intention of updating strutsws specifically for
1.3
(it should be a piece of cake to insert a command or two into the chain
to
perform the necessary functions), but I won't do that until 1.3 is a GA
release.  I actualy thought I wrote it against 1.2.4, I didn't realize
it
was 1.1, so the first chance I get I will update it for 1.2.4 at
least...
I only intend to support GA releases for strutsws as well as ajaxtags by
the way.

Hope that helps!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Tue, May 3, 2005 4:26 am, Marco Mistroni said:
> Hello all,
> 	I have downloaded strutsws by Frank Zammetti, which
> Enables struts app to be exposed as a webservice..
> It uses a custom controller(pls frank correct me if I m wrong) that
> Detects if request is an XML request...customizing then output so that
> it
> Will be an XML response that matches form data.
>
> Application works fine with Struts 1.1.. I have just written a
> <controller>
> Tag in struts-config and a  plugin used by strutsws.
>
> I found problems however with Struts 1.3, and I was wondering if, in
> Struts 1.3, was enough to define a  <controller> tag in
> struts-config.xml
> Or something else was needed..
>
>
> Thanx in advance and regards
> 	Marco
>
>
>


---------------------------------------------------------------------
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


Re: Struts 1.3 & custom controller

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Hi Marco,

You are correct, the custom controller is at the heart of strutsws.

I hesitate to answer about 1.3 because I've only looked at it very
briefly.  But, I'll try and answer and if someone more knowledgable sees
me flub something, please correct me...

Remember that 1.3 uses the CoR pattern to break down the request processor
into a chain of functions.  It is designed to be functionally equivalent
to the "current" request processor, but defined as a chain of Commands.

I seem to recall a thread at one point that said you still could in fact
use a custom monolithic processor... if that's not true than the bottom
line is simply that no, strutsws as it exists today will not be usable
with 1.3.

Let's assume however that I am remembering correctly and you CAN do
that... you'd still be inserting the 1.1 RP into the mix, which I'd bet
isn't what you really want to do.  It is also worth noting that I never
did a strutsws version for the Tiles processor, so Tiles and strutsws
don't mix at this point.  This hasn't been a big problem for most people
apparently (I guess they just set up a separate module for the web
services, I don't really know)...

...which does kind of raise an interesting question... assuming you can
use a non-chain RP in 1.3, it might be possible to just use the 1.1 RP in
a module for your web services.  If it's a module expressly for strutsws
functions, which RP you use might not matter as much (I could be wrong
though... there could have been some changes between 1.1 and 1.3 that
makes it not work, I frankly don't know).  I've never tied such a setup,
so I have no idea if it'll actually work.

Lastly, I do have the intention of updating strutsws specifically for 1.3
(it should be a piece of cake to insert a command or two into the chain to
perform the necessary functions), but I won't do that until 1.3 is a GA
release.  I actualy thought I wrote it against 1.2.4, I didn't realize it
was 1.1, so the first chance I get I will update it for 1.2.4 at least...
I only intend to support GA releases for strutsws as well as ajaxtags by
the way.

Hope that helps!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Tue, May 3, 2005 4:26 am, Marco Mistroni said:
> Hello all,
> 	I have downloaded strutsws by Frank Zammetti, which
> Enables struts app to be exposed as a webservice..
> It uses a custom controller(pls frank correct me if I m wrong) that
> Detects if request is an XML request...customizing then output so that
> it
> Will be an XML response that matches form data.
>
> Application works fine with Struts 1.1.. I have just written a
> <controller>
> Tag in struts-config and a  plugin used by strutsws.
>
> I found problems however with Struts 1.3, and I was wondering if, in
> Struts 1.3, was enough to define a  <controller> tag in
> struts-config.xml
> Or something else was needed..
>
>
> Thanx in advance and regards
> 	Marco
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Struts 1.3 & custom controller

Posted by Marco Mistroni <mm...@waersystems.com>.
Hello all,
	I have downloaded strutsws by Frank Zammetti, which
Enables struts app to be exposed as a webservice..
It uses a custom controller(pls frank correct me if I m wrong) that
Detects if request is an XML request...customizing then output so that
it
Will be an XML response that matches form data.

Application works fine with Struts 1.1.. I have just written a
<controller>
Tag in struts-config and a  plugin used by strutsws.

I found problems however with Struts 1.3, and I was wondering if, in
Struts 1.3, was enough to define a  <controller> tag in
struts-config.xml
Or something else was needed..


Thanx in advance and regards
	Marco



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by Dakota Jack <da...@gmail.com>.
Yes, Rick, exactly!

On 5/2/05, Rick Reumann <st...@reumann.net> wrote:
> Dakota Jack wrote the following on 5/2/2005 4:01 PM:
> >
> > The other aspect that is not discussed above is the removal of the
> > complexity from the "page".  This is where JSP, Taglibs, etc., come
> > into the picture.  And, I suspect, you two are talking about a
> > combination of this problem (keeping the page simple) and the previous
> > problem (using a reasonable architecture).
> 
> yes. For example, take a table sort example. I like being able to use
> JSTL (or even a display tag if that suits you) to display the collection
> info into the display of the table.
> 
> Doing something like this within a servlet (Action) wouldn't really be
> wrong, but just more difficult to maintain and more of pain to code
> (using StringBuffer and append bla bla).
> 
> --
> Rick
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by Rick Reumann <st...@reumann.net>.
Dakota Jack wrote the following on 5/2/2005 4:01 PM:
> 
> The other aspect that is not discussed above is the removal of the
> complexity from the "page".  This is where JSP, Taglibs, etc., come
> into the picture.  And, I suspect, you two are talking about a
> combination of this problem (keeping the page simple) and the previous
> problem (using a reasonable architecture).

yes. For example, take a table sort example. I like being able to use 
JSTL (or even a display tag if that suits you) to display the collection 
info into the display of the table.

Doing something like this within a servlet (Action) wouldn't really be 
wrong, but just more difficult to maintain and more of pain to code 
(using StringBuffer and append bla bla).

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by Dakota Jack <da...@gmail.com>.
I thought I would toss in a couple of philosophical points about the
HTML being created in the action.  As we know, the "technologies" of
Servlets and Taglibs essentially mask the fact that HTML is created
other than on the page.  I won't complete all my thinking on that. 
Just tossing that into the mix.  I do think that we should have an
MVC-like architecture but that it really should be expanded to be
clearly something that is compatible with a web structure.  Ted has
provided some good thinking on this, and his offhand remarks about a
web-MVC in fact is the "author" of most of my thinking about web based
architectrues .  Essentially, the "event' like contacts that you find
in desktop MVC is not sensibly available in HTTP contexts.  So, what
you do is try to make sure that each layer is coupled ONLY to the
prior layer and the next layer.  These layers need not be piled but
can have varying sorts of connections, figure eights, loop-a-loops,
etc.  How to do this with the given persistence scopes (request,
session, etc) and the needs to both persist and to kill data carrying
classes, is the trick for the VIEW layer, I think.

The other aspect that is not discussed above is the removal of the
complexity from the "page".  This is where JSP, Taglibs, etc., come
into the picture.  And, I suspect, you two are talking about a
combination of this problem (keeping the page simple) and the previous
problem (using a reasonable architecture).

My thought, then, is this.  The two distinct architectural differences
are very different and should be treated separately..  The later
issues are for efficiency of the human process. They are less
critical, except for the money, of course.  The prior issues are for
efficience of the computer process, and they are absolutely critical. 
Complications in the former are a pain but in the latter are never
bad, if effective.  Make sense?

On 5/2/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
> 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"); %>
> <table border="1" align="center" cellpadding="2" cellspacing="0">
> <tr>
> <th onClick="retrieveURL('example2RenderTable.do?sortField=firstName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">First Name</th>
> <th onClick="retrieveURL('example2RenderTable.do?sortField=middleName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Middle Name</th>
> <th onClick="retrieveURL('example2RenderTable.do?sortField=lastName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Last Name</th>
> <th
> onClick="retrieveURL('example2RenderTable.do?sortField=firstYearInOffice');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">First Year In Office</th>
> <th
> onClick="retrieveURL('example2RenderTable.do?sortField=lastYearInOffice');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Last Year In Office</th>
> </tr>
> <%
> for (Iterator it = sortedPresidentsList.iterator(); it.hasNext();) {
>   HashMap hm = (HashMap)it.next();
> %>
>   <tr>
>   <td><%=(String)hm.get("firstName")%></td>
>   <td><%=(String)hm.get("middleName")%></td>
>   <td><%=(String)hm.get("lastName")%></td>
>   <td><%=(String)hm.get("firstYearInOffice")%></td>
>   <td><%=(String)hm.get("lastYearInOffice")%></td>
>   </tr>
> <%
> }
> %>
> </table>
> 
> 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
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Hello,

I believe that your expectation about what should be happening here is 
not correct.

Think about the flow of events... When you change a combo box, you 
construct the query string and then submit that to your myAction Action. 
  This Action prepares the data, sets the collections in request and 
forwards to a JSP.

What does that JSP do at this point?  I'm betting it renders the entire 
page that you see initially, which isn't what you want.

When you use XMLHttpRequest, you aren't looking to refresh an entire 
page, just a portion of it.  To do this, you generally will want to 
return just a snippet of HTML, or XML, or other data structure that you 
will deal with client-side (i.e., parse and create HTML on-the-fly 
with).  It is left to you to determine which serves your purpose best.

Let's assume you want what is generally the simpler approach... what 
that would entail is your JSP rendering JUST the HTML that represents 
your <select> elements.  Then, in your page you would have them all 
wrapped in a <span> or <div>, and upon returning, in 
processStateChange(), you would set innerHTML of that <span> or <div> to 
what you got back from the server, which is what your JSP rendered. 
This is precisely what my example does.

I *think* what you are expecting to happen here is that since you have 
put the collections in request that your JSP will know how to deal with 
them, and indeed that is true.  But, remember that the JSP is processed 
server-side and returns plain HTML (generally).  In the case of a normal 
flow of events, the browser would then display that HTML, but when using 
XMLHttpRequest, it is not displayed (because it might not be displayable 
in any way that makes sense!), it is instead returned to memory on the 
client, and then your event handler is called, at which point you do 
whatever you need to do with it.  It is up to *you* to write the code to 
handle what the server returns <shamelessSelfPromotion>or use my 
AjaxTags and let it do the "heavy lifting", such as it 
is!</shamelessSelfPromotion>

I notice in your version of processStateChange() you in fact have a 
comment saying explicitly that you do nothing.  That's why you see 
nothing happen... that is precisely the place you need to update your 
display, and that is soley your responsibility (unless using AjaxTags). 
  It might be as simple as setting innerHTML as in my example, or you 
might construct a whole new DOM and display it, or something in between.

Let me know if you need further assistance :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

ahmet hassan wrote:
>   Hi all,
> I try to use XmlHttpRequest, but I can't
> successfully.I have a form which is composed  of 5
> select boxes and on each of them, I have onchange =
> "submitData()" ( taken from Zammetti's sample
> :)).Every combo data changes each time one
> changes.Anyway below the code:
> 
> <tr>
> <td class="cell02">Kurum Kodu : </td>
> <td class="cell02">
> <html:select
> property="memberID"onchange="submitData()">
> <html:option value="Tüm"/>
> <html:options collection =
> "MEMBERS_OF_INVESTOR"property="memberID"labelProperty="memberID"/>
> 
> </html:select>
> </td>
> 
> script is:
> 
> var req;
> var which;
> 
> function submitData() {
>     // Construct a CSV string from the entries.  Make
> sure all fields are
>     // filled in first.
>     m =
> document.accountStateReportForm.memberID.value;
>     s =
> document.accountStateReportForm.subAccountNo.value;
>     a =
> document.accountStateReportForm.accountNo.value;
>     alert(a);
>     i	=
> document.forms.accountStateReportForm.isinType.value;
>     if (m == "" || s == "" || a == "" || i == "" ) {
>      alert("Please fill in all fields first");
>     return false;
>    }
>     csv = m + "," + s + "," + a + "," + i  ;
>     // Ok, so now we retrieve the response as in all
> the other examples,
>     // except that now we append the CSV onto the URL
> as a query string,
>     // being sure to escape it first.
>    
> retrieveURL("fillCombosAccountStateReportReg.do?csv="
> + escape(csv));
>   }		       
> 
> function retrieveURL(url) {
>     if (window.XMLHttpRequest) { // Non-IE browsers
>       req = new XMLHttpRequest();
>       req.onreadystatechange = processStateChange;
>       try {
>         req.open("GET", url, true);
>       } catch (e) {
>         alert(e);
>       }
>       req.send(null);
>     } else if (window.ActiveXObject) { // IE
>       req = new ActiveXObject("Microsoft.XMLHTTP");
>       if (req) {
>         req.onreadystatechange = processStateChange;
>         req.open("GET", url, true);
>         req.send();
>       }
>     }
>   }
> function processStateChange() {
>     if (req.readyState == 4) { // Complete
>       if (req.status == 200) { // OK response
> 	
>       <%-- I do nothing here
> document.getElementById("accCombo").innerHTML =
> req.responseText; --%>
>       
>       } else {
>         alert("Problem: " + req.statusText);
>       }
>     }
>   }
> 
> I send form data to myAction, I prepare them and I set
> the collections data to request.
>  request.setAttribute("MEMBERS_OF_INVESTOR", members);
>      
> request.setAttribute("ACCOUNTS_OF_INVESTOR_MEMBER",accs);
>      
> request.setAttribute("SUB_ACCOUNTS_OF_INVESTOR_MEMBER",allSubAccountsCol);
> request.setAttribute("ISINS_OF_INVESTOR_MEMBER",allIsinsCol);
> return mapping.findForward("success");//REturns to the
>   same jsp.
>  But the combos don't change..?Eg:I see accounts combo
> is the same before I set new values to request and
> forward to my jsp.
> 
> <html:select property = "accountNo" 
> onchange="fillCombos(this, 0)">
> <html:option value="Tüm"/>
> <c:forEach var="a"
> items="${ACCOUNTS_OF_INVESTOR_MEMBER}">
> value="<c:out value="${a.accNo}"/>"><c:out
> value="${a.accNo}"/></option>
> </c:forEach>
> 							
> 							<%--<html:options collection =
> "ACCOUNTS_OF_INVESTOR_MEMBER" property="accNo"
> labelProperty="accNo"/> --%>
> 							
> 						</html:select> 
>   Thanks for help ? 
> Regards;
>          Özgür OKTAN
> 
> 
> --- "Frank W. Zammetti" <fz...@omnytex.com> wrote:
> 
> 
>>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");
> 
>>%>
>><table border="1" align="center" cellpadding="2"
>>cellspacing="0">
>><tr>
>><th
>>
> 
> onClick="retrieveURL('example2RenderTable.do?sortField=firstName');"
> 
>>onMouseOver="style.background='#c0c0c0';"
>>onMouseOut="style.background='';">First Name</th>
>><th
>>
> 
> onClick="retrieveURL('example2RenderTable.do?sortField=middleName');"
> 
>>onMouseOver="style.background='#c0c0c0';"
>>onMouseOut="style.background='';">Middle Name</th>
>><th
>>
> 
> onClick="retrieveURL('example2RenderTable.do?sortField=lastName');"
> 
>>onMouseOver="style.background='#c0c0c0';"
>>onMouseOut="style.background='';">Last Name</th>
>><th
>>
> 
> onClick="retrieveURL('example2RenderTable.do?sortField=firstYearInOffice');"
> 
>>onMouseOver="style.background='#c0c0c0';"
>>onMouseOut="style.background='';">First Year In
>>Office</th>
>><th
>>
> 
> onClick="retrieveURL('example2RenderTable.do?sortField=lastYearInOffice');"
> 
>>onMouseOver="style.background='#c0c0c0';"
>>onMouseOut="style.background='';">Last Year In
>>Office</th>
>></tr>
>><%
>>for (Iterator it = sortedPresidentsList.iterator();
>>it.hasNext();) {
>>  HashMap hm = (HashMap)it.next();
>>%>
>>  <tr>
>>  <td><%=(String)hm.get("firstName")%></td>
>>  <td><%=(String)hm.get("middleName")%></td>
>>  <td><%=(String)hm.get("lastName")%></td>
>>  <td><%=(String)hm.get("firstYearInOffice")%></td>
>>  <td><%=(String)hm.get("lastYearInOffice")%></td>
>>  </tr>
>><%
>>}
>>%>
>></table>
>>
>>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
>>
>>
> 
> 
> 
> 
> 		
> Discover Yahoo! 
> Stay in touch with email, IM, photo sharing and more. Check it out! 
> http://discover.yahoo.com/stayintouch.html
> 
> ---------------------------------------------------------------------
> 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


Re: ajax proj

Posted by ahmet hassan <ok...@yahoo.com>.
  Hi all,
I try to use XmlHttpRequest, but I can't
successfully.I have a form which is composed  of 5
select boxes and on each of them, I have onchange =
"submitData()" ( taken from Zammetti's sample
:)).Every combo data changes each time one
changes.Anyway below the code:

<tr>
<td class="cell02">Kurum Kodu : </td>
<td class="cell02">
<html:select
property="memberID"onchange="submitData()">
<html:option value="T�m"/>
<html:options collection =
"MEMBERS_OF_INVESTOR"property="memberID"labelProperty="memberID"/>

</html:select>
</td>

script is:

var req;
var which;

function submitData() {
    // Construct a CSV string from the entries.  Make
sure all fields are
    // filled in first.
    m =
document.accountStateReportForm.memberID.value;
    s =
document.accountStateReportForm.subAccountNo.value;
    a =
document.accountStateReportForm.accountNo.value;
    alert(a);
    i	=
document.forms.accountStateReportForm.isinType.value;
    if (m == "" || s == "" || a == "" || i == "" ) {
     alert("Please fill in all fields first");
    return false;
   }
    csv = m + "," + s + "," + a + "," + i  ;
    // Ok, so now we retrieve the response as in all
the other examples,
    // except that now we append the CSV onto the URL
as a query string,
    // being sure to escape it first.
   
retrieveURL("fillCombosAccountStateReportReg.do?csv="
+ escape(csv));
  }		       

function retrieveURL(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
      req = new XMLHttpRequest();
      req.onreadystatechange = processStateChange;
      try {
        req.open("GET", url, true);
      } catch (e) {
        alert(e);
      }
      req.send(null);
    } else if (window.ActiveXObject) { // IE
      req = new ActiveXObject("Microsoft.XMLHTTP");
      if (req) {
        req.onreadystatechange = processStateChange;
        req.open("GET", url, true);
        req.send();
      }
    }
  }
function processStateChange() {
    if (req.readyState == 4) { // Complete
      if (req.status == 200) { // OK response
	
      <%-- I do nothing here
document.getElementById("accCombo").innerHTML =
req.responseText; --%>
      
      } else {
        alert("Problem: " + req.statusText);
      }
    }
  }

I send form data to myAction, I prepare them and I set
the collections data to request.
 request.setAttribute("MEMBERS_OF_INVESTOR", members);
     
request.setAttribute("ACCOUNTS_OF_INVESTOR_MEMBER",accs);
     
request.setAttribute("SUB_ACCOUNTS_OF_INVESTOR_MEMBER",allSubAccountsCol);
request.setAttribute("ISINS_OF_INVESTOR_MEMBER",allIsinsCol);
return mapping.findForward("success");//REturns to the
  same jsp.
 But the combos don't change..?Eg:I see accounts combo
is the same before I set new values to request and
forward to my jsp.

<html:select property = "accountNo" 
onchange="fillCombos(this, 0)">
<html:option value="T�m"/>
<c:forEach var="a"
items="${ACCOUNTS_OF_INVESTOR_MEMBER}">
value="<c:out value="${a.accNo}"/>"><c:out
value="${a.accNo}"/></option>
</c:forEach>
							
							<%--<html:options collection =
"ACCOUNTS_OF_INVESTOR_MEMBER" property="accNo"
labelProperty="accNo"/> --%>
							
						</html:select> 
  Thanks for help ? 
Regards;
         �zg�r OKTAN


--- "Frank W. Zammetti" <fz...@omnytex.com> wrote:

> 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");
> %>
> <table border="1" align="center" cellpadding="2"
> cellspacing="0">
> <tr>
> <th
>
onClick="retrieveURL('example2RenderTable.do?sortField=firstName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">First Name</th>
> <th
>
onClick="retrieveURL('example2RenderTable.do?sortField=middleName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Middle Name</th>
> <th
>
onClick="retrieveURL('example2RenderTable.do?sortField=lastName');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Last Name</th>
> <th
>
onClick="retrieveURL('example2RenderTable.do?sortField=firstYearInOffice');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">First Year In
> Office</th>
> <th
>
onClick="retrieveURL('example2RenderTable.do?sortField=lastYearInOffice');"
> onMouseOver="style.background='#c0c0c0';"
> onMouseOut="style.background='';">Last Year In
> Office</th>
> </tr>
> <%
> for (Iterator it = sortedPresidentsList.iterator();
> it.hasNext();) {
>   HashMap hm = (HashMap)it.next();
> %>
>   <tr>
>   <td><%=(String)hm.get("firstName")%></td>
>   <td><%=(String)hm.get("middleName")%></td>
>   <td><%=(String)hm.get("lastName")%></td>
>   <td><%=(String)hm.get("firstYearInOffice")%></td>
>   <td><%=(String)hm.get("lastYearInOffice")%></td>
>   </tr>
> <%
> }
> %>
> </table>
> 
> 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
> 
> 



		
Discover Yahoo! 
Stay in touch with email, IM, photo sharing and more. Check it out! 
http://discover.yahoo.com/stayintouch.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
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"); %>
<table border="1" align="center" cellpadding="2" cellspacing="0">
<tr>
<th onClick="retrieveURL('example2RenderTable.do?sortField=firstName');"
onMouseOver="style.background='#c0c0c0';"
onMouseOut="style.background='';">First Name</th>
<th onClick="retrieveURL('example2RenderTable.do?sortField=middleName');"
onMouseOver="style.background='#c0c0c0';"
onMouseOut="style.background='';">Middle Name</th>
<th onClick="retrieveURL('example2RenderTable.do?sortField=lastName');"
onMouseOver="style.background='#c0c0c0';"
onMouseOut="style.background='';">Last Name</th>
<th
onClick="retrieveURL('example2RenderTable.do?sortField=firstYearInOffice');"
onMouseOver="style.background='#c0c0c0';"
onMouseOut="style.background='';">First Year In Office</th>
<th
onClick="retrieveURL('example2RenderTable.do?sortField=lastYearInOffice');"
onMouseOver="style.background='#c0c0c0';"
onMouseOut="style.background='';">Last Year In Office</th>
</tr>
<%
for (Iterator it = sortedPresidentsList.iterator(); it.hasNext();) {
  HashMap hm = (HashMap)it.next();
%>
  <tr>
  <td><%=(String)hm.get("firstName")%></td>
  <td><%=(String)hm.get("middleName")%></td>
  <td><%=(String)hm.get("lastName")%></td>
  <td><%=(String)hm.get("firstYearInOffice")%></td>
  <td><%=(String)hm.get("lastYearInOffice")%></td>
  </tr>
<%
}
%>
</table>

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


Re: ajax proj

Posted by Rick Reumann <st...@reumann.net>.
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


Re: ajax proj

Posted by Rick Reumann <st...@reumann.net>.
Frank W. Zammetti wrote the following on 5/2/2005 2:53 PM:

> Sometimes I think we all get so wrapped up in trying to achieve the
> perfect architecture that we overcomplicate things... 

amen brotha' Preaching to the choir:)

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Hmm... well, if I was doing something like that in real life I might well
do it from the Action :)  That doesn't make it the generally accepted
"right answer' thought.

I think most people would tell you to forward to a JSP to generate what
really amounts to just a snippet of HTML... IIRC, one of my examples does
that.  Keeps the view more properly separated and all that architectural
jazz.

Sometimes I think we all get so wrapped up in trying to achieve the
perfect architecture that we overcomplicate things... if all I'm returning
from the server is the HTML for a bunch of <option> elements, it doesn't
really strike me as a bad idea to do that in an Action (or maybe from a
delegate class that returns a string that the Action then returns).  I'm
not sure the developer community at large would agree with that though,
they seem to be more concerned with perfect architecture, hence that note
in the code :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, May 2, 2005 2:37 pm, Rick Reumann said:
> Frank W. Zammetti wrote the following on 5/2/2005 2:18 PM:
>> Glad your enjoying it Rick!  I hope you find something useful in it too.
>> :)
>>
>
> I see in your examples you make the note about writing the HTML in your
> Action is bad form, but I'm curious then how you handle this in real
> life. For example, looking at example 3 where the options list of
> "characters" changes based on your first selection, how/where do you
> write out the HTML that needs to be outputted to the response?
>
> Thanks again,
>
> --
> 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


Re: ajax proj

Posted by Rick Reumann <st...@reumann.net>.
Frank W. Zammetti wrote the following on 5/2/2005 2:18 PM:
> Glad your enjoying it Rick!  I hope you find something useful in it too. :)
> 

I see in your examples you make the note about writing the HTML in your 
Action is bad form, but I'm curious then how you handle this in real 
life. For example, looking at example 3 where the options list of 
"characters" changes based on your first selection, how/where do you 
write out the HTML that needs to be outputted to the response?

Thanks again,

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Glad your enjoying it Rick!  I hope you find something useful in it too. :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, May 2, 2005 2:00 pm, Rick Reumann said:
> Thanks for your Ajax/Struts PDF Frank. Reading it right now. Good stuff.
>
> Frank W. Zammetti wrote the following on 5/2/2005 1:40 PM:
>> Because of some technical difficulties that are being worked on (not
>> with
>> AjaxTags itself though), there is no official download available yet, of
>> the updated taglib or the sample app.  You would get it in exploded
>> format
>> as well, but that's probably not a big deal to anyone.
>>
>> If you want to play with it you will have to get it through CVS.  All
>> the
>> code for both the sample app and the taglibs themselves are there, just
>> grab the entire ajaxtags module.  You will need to build it using the
>> Ant
>> script included (no options or anything, just run ant in web-inf/src and
>> it should work).  Just copy the whole ajaxtags directory to your app
>> server of choice and it should (in theory) work.
>>
>
>
> --
> 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


Re: ajax proj

Posted by Rick Reumann <st...@reumann.net>.
Thanks for your Ajax/Struts PDF Frank. Reading it right now. Good stuff.

Frank W. Zammetti wrote the following on 5/2/2005 1:40 PM:
> Because of some technical difficulties that are being worked on (not with
> AjaxTags itself though), there is no official download available yet, of
> the updated taglib or the sample app.  You would get it in exploded format
> as well, but that's probably not a big deal to anyone.
> 
> If you want to play with it you will have to get it through CVS.  All the
> code for both the sample app and the taglibs themselves are there, just
> grab the entire ajaxtags module.  You will need to build it using the Ant
> script included (no options or anything, just run ant in web-inf/src and
> it should work).  Just copy the whole ajaxtags directory to your app
> server of choice and it should (in theory) work.
> 


-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax proj

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Because of some technical difficulties that are being worked on (not with
AjaxTags itself though), there is no official download available yet, of
the updated taglib or the sample app.  You would get it in exploded format
as well, but that's probably not a big deal to anyone.

If you want to play with it you will have to get it through CVS.  All the
code for both the sample app and the taglibs themselves are there, just
grab the entire ajaxtags module.  You will need to build it using the Ant
script included (no options or anything, just run ant in web-inf/src and
it should work).  Just copy the whole ajaxtags directory to your app
server of choice and it should (in theory) work.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, May 2, 2005 1:28 pm, Sergey Livanov said:
> Frank,
> Where can I find ajaxsample.war ?
>
>
> --
> Ñ óâàæåíèåì,
>  Sergey                          mailto:Sergey.Livanov@ukrpost.net
>
>
> ---------------------------------------------------------------------
> 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