You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Pilgrim, Peter" <pe...@csfb.com> on 2005/12/22 13:18:36 UTC

[OT] JavaWebParts and Struts / Ajax integration

Hi Frank et Al

I am not sure if the latest 1.0 current version of JavaWebPart
actually distributes the right libraries. 

If looks like ``javawebparts_core.jar'' has the wrong base dir.

It contains strangs paths that look incorrect e.g 
	
	`javawebparts\core\org\apache\commons\beanutils'. 

I would have thought it should have been `

	`org\apache\commons\beanutils''

In order to build the type suggestion, what are the correct jars
to include. I thought it was ``javawebparts_core.jar'' 
and ``javawebparts_taglibs.jar''. Now I get a strange deployment
error like Error: Could not load asds: weblogic.servlet.jsp.JspException: (line 6): Error in using tag library uri='/tags/javawebparts_ajaxtags.tld' prefix='ajax': cannot find tag class: 'javawebparts.taglib.ajaxtags.AjaxEventTag'

> -----Original Message-----
> From: Frank W. Zammetti [mailto:fzlists@omnytex.com]
> Sent: 04 December 2005 04:18
> To: Sonali Kulkarni; Struts User
> Subject: Re: Integrating Struts in DWR??
> 
> 
> Sorry about that, I obviously screwed up in QC... the latest build of 
> AjaxChat IS NOT A PROPER WEBAPP.  My build script is obviously not 
> working right as far as the distro task goes, and I didn't notice. 
> Please use the v1.0 alpha, NOT alpha2, which is, AFAIK, correct.  It 
> does have some bugs, but they shouldn't bother you if you are just 
> checking the AJAX stuff out.
> 
> I will correct the latest version tomorrow and cut a new 
> release... it 
> is ready to be called 1.0 GA at this point anyway, so it's 
> just as well. 
>   Alternatively, you could check out from CVS HEAD right now, which 
> should work fine, but you'll have to compile first.
> 
> Frank
> 
> Sonali Kulkarni wrote:
> > Hi Frank,
> >  
> > I downloaded ajaxchat.zip from 
> > link 
> http://sourceforge.net/project/showfiles.php?group_id=49385&pa
> ckage_id=171010&release_id=375018 
> > 
> <http://sourceforge.net/project/showfiles.php?group_id=49385&p
> ackage_id=171010&release_id=375018>
> >  
> > But I could not find abt jsp files in the zip, Hence cannot run the 
> > application.
> > I am planning to run it in Tomcat. Where can I get the 
> complete source code
> > for the application, that I can run, and study.
> >  
> > Thanks,
> > Sonali
> > 
> >  
> > On 12/3/05, *Frank W. Zammetti* <fzlists@omnytex.com 
> > <ma...@omnytex.com>> wrote:
> > 
> >     Some of the questions you ask here are really more for 
> you to decide...
> >     there aren't any canned answers.  That being said, I'll 
> do my best...
> > 
> >     To begin with, I highly suggest checking out the 
> numerous articles on
> >     AJAX out there to get a firm grasp on what it really 
> is, and if I may be
> >     so bold, start with my own:
> > 
> >     http://www.omnytex.com/articles
> > 
> >     This will show one way AJAX can be integrated with 
> Struts.  You can also
> >     check out my AjaxChat example app on the Struts Apps 
> SourceForge site:
> > 
> >     http://struts.sourceforge.net
> > 
> >     The short answer is that AJAX, generically, is nothing 
> but an HTTP
> >     request.  As far as whatever is on the server is 
> concerned, be it a
> >     Struts apps or something else, it doesn't look any 
> different than any
> >     other request.  Well, I suppose more accurately, it 
> doesn't *have* to
> >     look any different.  If you simply pass simple 
> parameters from the
> >     client and forego XML, then to Struts there's no difference.
> > 
> >     If you want to use XML and Struts, then you will at 
> this point have to
> >     do your own parsing.  With Struts 1.3, it would be 
> trivial to add a
> >     Command to the processing chain to parse an incoming 
> XML message and
> >     translate it to request parameters... come to think of 
> it, that exists
> >     already:
> > 
> >     http://sourceforge.net/projects/strutsws
> > 
> >     Although that's for Web Services, the underlying theory 
> is identical.
> >     There is a 1.3 version, courtesy of Marco Mistroni, but 
> you can see my
> >     original version with the customized RP.  The same 
> thing would work
> >     nicely for AJAX, although one can envision other ways 
> of doing it too.
> > 
> >     You could just as well have this function in your 
> servlet... it's
> >     just a
> >     matter of getting the body content of the HTTP request, 
> which would be
> >     XML, parsing it and doing what you'd always do.  If 
> this interests you,
> >     have a look at the code in CVS HEAD here:
> > 
> >     http://javawebparts.sourceforge.net
> > 
> >     I'll probably cut a release this weekend, but the code 
> in CVS for the
> >     AjaxTags component in the sample app does exactly 
> that... an AJAX
> >     request is made with XML in the HTTP body, and a 
> servlet in this case
> >     gets it (via the handy RequestHelpers.getBodyContent() 
> method) and then
> >     uses Digester to parse it.
> > 
> >     Everything I've talked about here is "naked" AJAX, 
> i.e., without the
> >     help of any particular library.  AJAX is really quite 
> simple, aside
> >     from
> >     a few gotchas, but there are some very robust libraries 
> that will help
> >     with more than the basics in most cases.  They all seem 
> to have a
> >     slightly different focus from one another, so if you'd 
> prefer to go that
> >     route, some (of the many!) to look at are:
> > 
> >     
> http://javawebparts.sourceforge.net/javadocs/javawebparts/tagl
> ib/ajaxtags/package-summary.html
> >     
> <http://javawebparts.sourceforge.net/javadocs/javawebparts/tag
> lib/ajaxtags/package-summary.html>
> > 
> >     This is the AjaxTags component of Java Web Parts... 
> this is a little
> >     different than the rest in that it makes enabling 
> specific events very
> >     easy.  All it requires is adding custom tags to your page, and
> >     configuring various AJAX events via XML config file.  
> For instance, if
> >     you want to fire an AJAX event when a <div> is clicked, 
> and then you
> >     want a function that will populate another <div> from 
> what the server
> >     returns, this is a trivial exercise with AjaxTags, and 
> it's all driven
> >     by config file so there is no coding involved, aside 
> from adding a tag
> >     or two to your page.  This is my own creation, so obviously I'll
> >     push it
> >     a little more than the rest, but I truly do believe it 
> offers something
> >     than most other options do not and you probably should 
> at least check it
> >     out and see if it meets your needs.
> > 
> >     http://dojotoolkit.com/
> >     This is the one people are starting to really get 
> behind, and from what
> >     I can see there is good reason for it.  This is one of 
> the ones that
> >     will give you more than just AJAX, and that might be 
> very appealing
> >     to you.
> > 
> >     DWR of course you already know about.
> > 
> >     http://prototype.conio.net/
> >     Prototype is actually more of a foundation as there are 
> other libraries
> >     that use it.  So certainly check out some of those 
> libraries, but
> >     Prototype on its own might be something you want to use.
> > 
> >     There is no canonical answer at present for integrating 
> with Struts, but
> >     the point is there probably doesn't ever have to be 
> one... it's just an
> >     HTTP request.  Oh, there could be something added to 
> Struts to handle
> >     automatic parsing of XML and stuffing it into an 
> ActionForm, that might
> >     not be a bad idea, but since you have access to the 
> request object
> >     anyway in an Action, you can do everything that Struts 
> would ever do
> >     for
> >     you so it would probably be unnecessary to add it to Struts.
> > 
> >     To the question of whether AJAX is appropriate or 
> not... first, from a
> >     security standpoint, AJAX is no different from every 
> form you submit,
> >     every window.location call you make, every image you 
> GET, etc.  The same
> >     security concerns that arise in those instances are 
> present with AJAX.
> >     AJAX has a limitation in that it can't make requests to 
> domains other
> >     than the one that served the page it's on, so in a 
> sense it's MORE
> >     secure.  But the bottom line is you secure AJAX the 
> same way you secure
> >     your webapps generally.
> > 
> >     If your wondering if it's worth it, that of course is 
> for you to answer.
> >     There are some cases where it absolutely makes things 
> better, but it
> >     comes with some baggage... unless you spend a lot of 
> time worrying about
> >     graceful degredation, your app will now *require* 
> scripting.  This might
> >     not be a problem for you, but it might be.  AJAX is 
> also a problem for
> >     accessability.  In some cases this is a major problem, 
> but even when
> >     it's not it's something we should all think about.  It 
> also raises the
> >     level of expertise your app requires to maintain.
> > 
> >     I'm personally a fan of AJAX.  I've been doing AJAX for 
> over 5 years
> >     (keep in mind that AJAX is really more a philosophy and 
> an approach than
> >     it is any specific technology... I haven't used 
> XMLHttpRequest for very
> >     long, but I accomplished the same types of things in an 
> app 5 years
> >     ago).  I believe the age of the "classic" web, where 
> scripting is
> >     optional and apps redraw entire screens, is dead.  AJAX 
> itself is
> >     nothing knew, but the mindset that accompanies it 
> largely is, so if
> >     your
> >     asking *me* if its a good idea in the first place, I'd 
> say absolutely
> >     yes, assuming two things... first, that the way you 
> want to apply it
> >     makes sense; anything can be used in a pointless way of 
> course!, and
> >     second, that you understand and can accept all the 
> caveats that go along
> >     with it.
> > 
> >     Hope that helps!
> > 
> >     Frank
> > 
> >     Sonali Kulkarni wrote:
> >      > So, does it mean that is it not a good idea to use DWR with
> >     Struts just as
> >      > yet?
> >      >
> >      > If so, what would be the best way to integrate AJAX 
> into our Struts
> >      > application?
> >      >
> >      > Ours is a full-blown *financial* banking Struts application.
> >     Please also let
> >      > me know if it is a good idea to use AJAX in the first place,
> >     considering (1)
> >      > the security risks imposed, especially for a financial
> >     application (2) ease
> >      > of integrating AJAX with Struts. (some of the 
> questions i have,
> >     for starters
> >      > are... how do i pass the request object from the 
> javascript to my
> >     action
> >      > class method, ... how do i handle errors returned etc)
> >      >
> >      > Thanks for your time! Any replies would be appreciated!
> >      >
> >      >
> >      > On 12/3/05, Frank W. Zammetti < fzlists@omnytex.com
> >     <ma...@omnytex.com>> wrote:
> >      >
> >      >>From the DWR web site:
> >      >>
> >      >>http://getahead.ltd.uk/dwr/server/struts
> >      >>
> >      >>Just reading through it quickly, that's just about 
> what I would have
> >      >>suggested too in terms of separating out core logic 
> from Actions and
> >      >>letting your Actions and DWR servlet call them as 
> needed.  There
> >     might
> >      >>be some better approaches, but it sounds like the DWR team is
> >     looking
> >      >>for those approaches themselves.
> >      >>
> >      >>Frank
> >      >>
> >      >>Sonali Kulkarni wrote:
> >      >>
> >      >>>Please suggest if there are any good links, or some 
> working examples
> >      >>
> >      >>that
> >      >>
> >      >>>explain how Struts could be integrated into the DWR (AJAX)
> >     framework.
> >      >>
> >      >>Any
> >      >>
> >      >>>help would be appreciated. There is hardly any 
> online support or
> >      >>>documentation.
> >      >>>
> >      >>>Thanks!
> >      >>>
> >      >>
==////==

--
Peter Pilgrim :: J2EE Software Development
Operations/IT - Credit Suisse First Boston, 
Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom
Tel: +44-(0)207-883-4497


==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: 

http://www.csfb.com/legal_terms/disclaimer_external_email.shtml

==============================================================================


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


Re: [OT] JavaWebParts and Struts / Ajax integration

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Peter A. Pilgrim wrote:
> Well that ok because I am now official on holiday (vacation ;-)

As am I :)  I have plenty of work to do at home though!

> Ok that makes sense then. Maybe when people switch Maven 2 then this
> dependency issues can be worked out.

Maybe.  I know *I* won't be switching to Maven any time soon, 1 *or* 2. 
  Ant still serves my purposes just fine (did you notice the 
dependencies task in the JWP script?  Ironic that it uses the Maven 
repository!)

Even with Maven, it would still be an external dependency though... if 
someone uses JWP in their project, they would still need to know that 
they need Commons Lang and Commons BeanUtils and so on, even if they are 
simply going to specify it in their Maven config and forget about it.  I 
prefer not having those dependencies at all, hence the reason they got 
rolled in.

>>> In order to build the type suggestion, what are the correct jars
>>> to include. I thought it was ``javawebparts_core.jar'' and 
>>> ``javawebparts_taglibs.jar''. Now I get a strange deployment
>>> error like Error: Could not load asds: 
>>> weblogic.servlet.jsp.JspException: (line 6): Error in using tag 
>>> library uri='/tags/javawebparts_ajaxtags.tld' prefix='ajax': cannot 
>>> find tag class: 'javawebparts.taglib.ajaxtags.AjaxEventTag'
>>
>>
> 
> I downloaded the 1.0 beta release version. I found that the binary
> release included *.class in the javawebparts_taglib.jar file.
> Also, I checked the javawebparts_core.jar file. This was fine.
> 
> I think there is problem with the `make_jars' in the ant build. I found
> that running that ant target (re-)created all the jars, but the 
> `javawebparts_taglib.jar' contained only the TLD and Manifest.mf. Weird.

Not really weird I think, and this is actually a point Tamas, one of the 
other JWP developers, has been making to me... the Ant targets are not 
completely independent.  What I mean is, the script should always just 
be executed by executing Ant with no target specification.  You control 
what targets are executed by altering the build.properties file.  I've 
always preferred it this way because it seems more programming-like to 
me, and you never have to worry about what targets you need to execute 
from the command line (us non-IDE guys like this because we can just 
point to a new directory in our macros and that's it).  Tamas has been 
trying to convince me that this is atypical and maybe should be changed. 
  He may be right! :)

However, in this case, I don't think it would have mattered anyway... if 
you haven't executed the compile target, then executing make_jar should 
result in exactly what you saw because there are no class files to include.

> I am trying to add javawebparts to the current Struts project for my 
> client at work. I am truying add to auto completion (Google Suggest) for
> a couple administration screen in the application. I followed the 
> instructions in the JavaDoc for the taglib. Unfortunately I could not 
> deploy the application to Weblogic because somehow the taglibs were not 
> being found. Somehow the project does not find the Javawebparts classes 
> at all. I tried various things yesterday like playing around with the 
> URI. Making sure that it was maps a taglib in the web.xml. I checked the 
> build WAR that both libraries javawebparts_{taglib,core}.jar were being 
> included in WEB-INF/lib.

My only other suggestion would be to pull the TLD from the JAR and put 
it in WEB-INF and updated the definition on the page accordingly.  That 
*should* eliminate any possible classloader/classpath problems.  Then 
again, maybe not, since it looks like its the *class* that isn't being 
found.  That I definitely don't understand.  If you've checked the JAR 
yourself and the class is there, and is in the correct package 
structure, it's pretty clearly a classpath issue like your thinking it 
might be already.

> Away from work I think this is classpath issue of some time. I bet
> I have to set up the libraries in EAR as well, because of something
> I found unusual in WebLogic 8.1 that my client uses. In Weblogic
> that EAR classloader takes precedence over the WAR classloader.
> So if there is class dependency in javawebparts that requires
> a JAR loaded in the EAR classloader, then it fail of course.

Hehe... we're a Websphere shop... if you want to compare classloader 
issues, I guarantee you'll lose :)  Websphere has got to have the most 
complex classloader in history.  I can't tell you how many times we've 
had to mess with things like your describing.  I have a situation now, 
probably not a classloader issue but still, where Websphere won't let me 
use JSTL and is complaining about no more tag prefix room available. 
Very annoying.

> The other weird thing, at work I use MyEclipse 4.0 and Eclipse 3.1 and
> MyEclipse could not recognise the <ajax:event> or <ajax:enable> custom 
> tags and it flagged them as unknown tags. The Struts tags are unknown.
> This should have been a big clue to me, that something was wrong.
> MyEclipse is normally very good at picking up any custom TLD. However it 
> just underlinedin yellow any <ajax:*> tags. Crap, I dont know what is 
> wrong until I get back to work in January 2006.

Please do let me know what you find... if its something I can fix I 
definitely want to do so.  I can tell you I have successfully used 
AjaxTags in a number of projects running on Tomcat, and have also used 
it in Resin and Websphere, and I know some others who have run it on 
those app servers as well.  I don't know anyone who has used it in 
Weblogic, and I don't use an IDE so I can't say anything about the 
Eclipse problems... I haven't heard any similar complaints though.

> Frank, Could you check your distribution release is correct in the 
> meantime? Could you write a very simple HOWTO and how to incorporate
> AjaxTags with Struts?

I just checked the 1.0beta1 distro and it looks good.  The taglib jar 
has all the required files and they are all in the correct directory 
structure.  FYI, I'm writing an app right now using the latest AjaxTags, 
  and it is working as expected (under Tomcat though).

As for using it with Struts, it's no different than using it outside 
Struts... the version of AjaxTags in JWP is completely 
framework-agnostic.  The only thing to be aware of that I can think of 
is if you have event handlers on your tags and you then add an AjaxTags 
event to it, your event handlers will be overwritten.  This would break 
things like client-side validation.  Other than that, it shouldn't 
matter if your using Struts or not, the steps defined in the 
documentation now would be exactly the same.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

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


Re: [OT] JavaWebParts and Struts / Ajax integration

Posted by "Peter A. Pilgrim" <pe...@xenonique.co.uk>.
Frank W. Zammetti wrote:
> Sorry to not reply sooner Peter... my web host has been under a major 
> DoS attack today, my mail just came back up a minute or so ago.
> 

Well that ok because I am now official on holiday (vacation ;-)

> Pilgrim, Peter wrote:
> 
>> Hi Frank et Al
>>
>> I am not sure if the latest 1.0 current version of JavaWebPart
>> actually distributes the right libraries.
>> If looks like ``javawebparts_core.jar'' has the wrong base dir.
>>
>> It contains strangs paths that look incorrect e.g     
>>     `javawebparts\core\org\apache\commons\beanutils'.
>> I would have thought it should have been `
>>
>>     `org\apache\commons\beanutils''
> 
> 
> Those paths actually *are* correct... a few releases back we rolled in 
> some Commons code so that there would be no external dependencies 
> (except for Commons Logging, which we left external to try and alleviate 
> any classloaded issues that might arise).  To do this, the packages were 
> modified so that org/apache/commons/* is under javawebparts/core.
> 

Ok that makes sense then. Maybe when people switch Maven 2 then this
dependency issues can be worked out.


>> In order to build the type suggestion, what are the correct jars
>> to include. I thought it was ``javawebparts_core.jar'' and 
>> ``javawebparts_taglibs.jar''. Now I get a strange deployment
>> error like Error: Could not load asds: 
>> weblogic.servlet.jsp.JspException: (line 6): Error in using tag 
>> library uri='/tags/javawebparts_ajaxtags.tld' prefix='ajax': cannot 
>> find tag class: 'javawebparts.taglib.ajaxtags.AjaxEventTag'
>

I downloaded the 1.0 beta release version. I found that the binary
release included *.class in the javawebparts_taglib.jar file.
Also, I checked the javawebparts_core.jar file. This was fine.

I think there is problem with the `make_jars' in the ant build. I found
that running that ant target (re-)created all the jars, but the 
`javawebparts_taglib.jar' contained only the TLD and Manifest.mf. Weird.



> 
> That's right, only the core (which is always required) and the taglib 
> jars should be required.

Yes I had a look at the cookbook examples (both of them). I deployed
them both to Weblogic and there both worked no problem at all. I think
I had to manually create a WAR files for both examples using `jar'.

> 
> I'm confused though... are you trying to build the cookbook apps or the 
> sample app, or your own app?  It *looks* like a simple classpath issue, 
> the taglib jar doesn't look to be found by Weblogic.  You can also take 
> a look in your server logs... Every class in JWP does a dependency check 
> at classload and will report via System.err any dependencies (outside 
> the JDK) that it can't find.  I actually burned myself a week or so ago 
> trying to use the Chain implementation and forgot to include the code 
> JAR, and for a few hours my webapp was just silently not starting up, no 
> errors or anything.  I finally figured it out (D'oh!) and decided *that* 
> wasn't going to happen again :)
> 
> Frank
> 

I am trying to add javawebparts to the current Struts project for my 
client at work. I am truying add to auto completion (Google Suggest) for
a couple administration screen in the application. I followed the 
instructions in the JavaDoc for the taglib. Unfortunately I could not 
deploy the application to Weblogic because somehow the taglibs were not 
being found. Somehow the project does not find the Javawebparts classes 
at all. I tried various things yesterday like playing around with the 
URI. Making sure that it was maps a taglib in the web.xml. I checked the 
build WAR that both libraries javawebparts_{taglib,core}.jar were being 
included in WEB-INF/lib.


Away from work I think this is classpath issue of some time. I bet
I have to set up the libraries in EAR as well, because of something
I found unusual in WebLogic 8.1 that my client uses. In Weblogic
that EAR classloader takes precedence over the WAR classloader.
So if there is class dependency in javawebparts that requires
a JAR loaded in the EAR classloader, then it fail of course.

The other weird thing, at work I use MyEclipse 4.0 and Eclipse 3.1 and
MyEclipse could not recognise the <ajax:event> or <ajax:enable> custom 
tags and it flagged them as unknown tags. The Struts tags are unknown.
This should have been a big clue to me, that something was wrong.
MyEclipse is normally very good at picking up any custom TLD. However it 
just underlinedin yellow any <ajax:*> tags. Crap, I dont know what is 
wrong until I get back to work in January 2006.

Frank, Could you check your distribution release is correct in the 
meantime? Could you write a very simple HOWTO and how to incorporate
AjaxTags with Struts?

-- 
Peter Pilgrim
            __ _____ _____ _____
           / //__  // ___// ___/   +  Serverside Java
          / /___/ // /__ / /__     +  Struts
         / // ___// ___// ___/     +  Expresso Committer
      __/ // /__ / /__ / /__       +  Independent Contractor
     /___//____//____//____/       +  Intrinsic Motivation
On Line Resume
    ||
    \\===>  `` http://www.xenonsoft.demon.co.uk/no-it-striker.html ''

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


Re: [OT] JavaWebParts and Struts / Ajax integration

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Sorry to not reply sooner Peter... my web host has been under a major 
DoS attack today, my mail just came back up a minute or so ago.

Pilgrim, Peter wrote:
> Hi Frank et Al
> 
> I am not sure if the latest 1.0 current version of JavaWebPart
> actually distributes the right libraries. 
> 
> If looks like ``javawebparts_core.jar'' has the wrong base dir.
> 
> It contains strangs paths that look incorrect e.g 
> 	
> 	`javawebparts\core\org\apache\commons\beanutils'. 
> 
> I would have thought it should have been `
> 
> 	`org\apache\commons\beanutils''

Those paths actually *are* correct... a few releases back we rolled in 
some Commons code so that there would be no external dependencies 
(except for Commons Logging, which we left external to try and alleviate 
any classloaded issues that might arise).  To do this, the packages were 
modified so that org/apache/commons/* is under javawebparts/core.

> In order to build the type suggestion, what are the correct jars
> to include. I thought it was ``javawebparts_core.jar'' 
> and ``javawebparts_taglibs.jar''. Now I get a strange deployment
> error like Error: Could not load asds: weblogic.servlet.jsp.JspException: (line 6): Error in using tag library uri='/tags/javawebparts_ajaxtags.tld' prefix='ajax': cannot find tag class: 'javawebparts.taglib.ajaxtags.AjaxEventTag'

That's right, only the core (which is always required) and the taglib 
jars should be required.

I'm confused though... are you trying to build the cookbook apps or the 
sample app, or your own app?  It *looks* like a simple classpath issue, 
the taglib jar doesn't look to be found by Weblogic.  You can also take 
a look in your server logs... Every class in JWP does a dependency check 
at classload and will report via System.err any dependencies (outside 
the JDK) that it can't find.  I actually burned myself a week or so ago 
trying to use the Chain implementation and forgot to include the code 
JAR, and for a few hours my webapp was just silently not starting up, no 
errors or anything.  I finally figured it out (D'oh!) and decided *that* 
wasn't going to happen again :)

Frank

> 
>>-----Original Message-----
>>From: Frank W. Zammetti [mailto:fzlists@omnytex.com]
>>Sent: 04 December 2005 04:18
>>To: Sonali Kulkarni; Struts User
>>Subject: Re: Integrating Struts in DWR??
>>
>>
>>Sorry about that, I obviously screwed up in QC... the latest build of 
>>AjaxChat IS NOT A PROPER WEBAPP.  My build script is obviously not 
>>working right as far as the distro task goes, and I didn't notice. 
>>Please use the v1.0 alpha, NOT alpha2, which is, AFAIK, correct.  It 
>>does have some bugs, but they shouldn't bother you if you are just 
>>checking the AJAX stuff out.
>>
>>I will correct the latest version tomorrow and cut a new 
>>release... it 
>>is ready to be called 1.0 GA at this point anyway, so it's 
>>just as well. 
>>  Alternatively, you could check out from CVS HEAD right now, which 
>>should work fine, but you'll have to compile first.
>>
>>Frank
>>
>>Sonali Kulkarni wrote:
>>
>>>Hi Frank,
>>> 
>>>I downloaded ajaxchat.zip from 
>>>link 
>>
>>http://sourceforge.net/project/showfiles.php?group_id=49385&pa
>>ckage_id=171010&release_id=375018 
>>
>><http://sourceforge.net/project/showfiles.php?group_id=49385&p
>>ackage_id=171010&release_id=375018>
>>
>>> 
>>>But I could not find abt jsp files in the zip, Hence cannot run the 
>>>application.
>>>I am planning to run it in Tomcat. Where can I get the 
>>
>>complete source code
>>
>>>for the application, that I can run, and study.
>>> 
>>>Thanks,
>>>Sonali
>>>
>>> 
>>>On 12/3/05, *Frank W. Zammetti* <fzlists@omnytex.com 
>>><ma...@omnytex.com>> wrote:
>>>
>>>    Some of the questions you ask here are really more for 
>>
>>you to decide...
>>
>>>    there aren't any canned answers.  That being said, I'll 
>>
>>do my best...
>>
>>>    To begin with, I highly suggest checking out the 
>>
>>numerous articles on
>>
>>>    AJAX out there to get a firm grasp on what it really 
>>
>>is, and if I may be
>>
>>>    so bold, start with my own:
>>>
>>>    http://www.omnytex.com/articles
>>>
>>>    This will show one way AJAX can be integrated with 
>>
>>Struts.  You can also
>>
>>>    check out my AjaxChat example app on the Struts Apps 
>>
>>SourceForge site:
>>
>>>    http://struts.sourceforge.net
>>>
>>>    The short answer is that AJAX, generically, is nothing 
>>
>>but an HTTP
>>
>>>    request.  As far as whatever is on the server is 
>>
>>concerned, be it a
>>
>>>    Struts apps or something else, it doesn't look any 
>>
>>different than any
>>
>>>    other request.  Well, I suppose more accurately, it 
>>
>>doesn't *have* to
>>
>>>    look any different.  If you simply pass simple 
>>
>>parameters from the
>>
>>>    client and forego XML, then to Struts there's no difference.
>>>
>>>    If you want to use XML and Struts, then you will at 
>>
>>this point have to
>>
>>>    do your own parsing.  With Struts 1.3, it would be 
>>
>>trivial to add a
>>
>>>    Command to the processing chain to parse an incoming 
>>
>>XML message and
>>
>>>    translate it to request parameters... come to think of 
>>
>>it, that exists
>>
>>>    already:
>>>
>>>    http://sourceforge.net/projects/strutsws
>>>
>>>    Although that's for Web Services, the underlying theory 
>>
>>is identical.
>>
>>>    There is a 1.3 version, courtesy of Marco Mistroni, but 
>>
>>you can see my
>>
>>>    original version with the customized RP.  The same 
>>
>>thing would work
>>
>>>    nicely for AJAX, although one can envision other ways 
>>
>>of doing it too.
>>
>>>    You could just as well have this function in your 
>>
>>servlet... it's
>>
>>>    just a
>>>    matter of getting the body content of the HTTP request, 
>>
>>which would be
>>
>>>    XML, parsing it and doing what you'd always do.  If 
>>
>>this interests you,
>>
>>>    have a look at the code in CVS HEAD here:
>>>
>>>    http://javawebparts.sourceforge.net
>>>
>>>    I'll probably cut a release this weekend, but the code 
>>
>>in CVS for the
>>
>>>    AjaxTags component in the sample app does exactly 
>>
>>that... an AJAX
>>
>>>    request is made with XML in the HTTP body, and a 
>>
>>servlet in this case
>>
>>>    gets it (via the handy RequestHelpers.getBodyContent() 
>>
>>method) and then
>>
>>>    uses Digester to parse it.
>>>
>>>    Everything I've talked about here is "naked" AJAX, 
>>
>>i.e., without the
>>
>>>    help of any particular library.  AJAX is really quite 
>>
>>simple, aside
>>
>>>    from
>>>    a few gotchas, but there are some very robust libraries 
>>
>>that will help
>>
>>>    with more than the basics in most cases.  They all seem 
>>
>>to have a
>>
>>>    slightly different focus from one another, so if you'd 
>>
>>prefer to go that
>>
>>>    route, some (of the many!) to look at are:
>>>
>>>    
>>
>>http://javawebparts.sourceforge.net/javadocs/javawebparts/tagl
>>ib/ajaxtags/package-summary.html
>>
>>>    
>>
>><http://javawebparts.sourceforge.net/javadocs/javawebparts/tag
>>lib/ajaxtags/package-summary.html>
>>
>>>    This is the AjaxTags component of Java Web Parts... 
>>
>>this is a little
>>
>>>    different than the rest in that it makes enabling 
>>
>>specific events very
>>
>>>    easy.  All it requires is adding custom tags to your page, and
>>>    configuring various AJAX events via XML config file.  
>>
>>For instance, if
>>
>>>    you want to fire an AJAX event when a <div> is clicked, 
>>
>>and then you
>>
>>>    want a function that will populate another <div> from 
>>
>>what the server
>>
>>>    returns, this is a trivial exercise with AjaxTags, and 
>>
>>it's all driven
>>
>>>    by config file so there is no coding involved, aside 
>>
>>from adding a tag
>>
>>>    or two to your page.  This is my own creation, so obviously I'll
>>>    push it
>>>    a little more than the rest, but I truly do believe it 
>>
>>offers something
>>
>>>    than most other options do not and you probably should 
>>
>>at least check it
>>
>>>    out and see if it meets your needs.
>>>
>>>    http://dojotoolkit.com/
>>>    This is the one people are starting to really get 
>>
>>behind, and from what
>>
>>>    I can see there is good reason for it.  This is one of 
>>
>>the ones that
>>
>>>    will give you more than just AJAX, and that might be 
>>
>>very appealing
>>
>>>    to you.
>>>
>>>    DWR of course you already know about.
>>>
>>>    http://prototype.conio.net/
>>>    Prototype is actually more of a foundation as there are 
>>
>>other libraries
>>
>>>    that use it.  So certainly check out some of those 
>>
>>libraries, but
>>
>>>    Prototype on its own might be something you want to use.
>>>
>>>    There is no canonical answer at present for integrating 
>>
>>with Struts, but
>>
>>>    the point is there probably doesn't ever have to be 
>>
>>one... it's just an
>>
>>>    HTTP request.  Oh, there could be something added to 
>>
>>Struts to handle
>>
>>>    automatic parsing of XML and stuffing it into an 
>>
>>ActionForm, that might
>>
>>>    not be a bad idea, but since you have access to the 
>>
>>request object
>>
>>>    anyway in an Action, you can do everything that Struts 
>>
>>would ever do
>>
>>>    for
>>>    you so it would probably be unnecessary to add it to Struts.
>>>
>>>    To the question of whether AJAX is appropriate or 
>>
>>not... first, from a
>>
>>>    security standpoint, AJAX is no different from every 
>>
>>form you submit,
>>
>>>    every window.location call you make, every image you 
>>
>>GET, etc.  The same
>>
>>>    security concerns that arise in those instances are 
>>
>>present with AJAX.
>>
>>>    AJAX has a limitation in that it can't make requests to 
>>
>>domains other
>>
>>>    than the one that served the page it's on, so in a 
>>
>>sense it's MORE
>>
>>>    secure.  But the bottom line is you secure AJAX the 
>>
>>same way you secure
>>
>>>    your webapps generally.
>>>
>>>    If your wondering if it's worth it, that of course is 
>>
>>for you to answer.
>>
>>>    There are some cases where it absolutely makes things 
>>
>>better, but it
>>
>>>    comes with some baggage... unless you spend a lot of 
>>
>>time worrying about
>>
>>>    graceful degredation, your app will now *require* 
>>
>>scripting.  This might
>>
>>>    not be a problem for you, but it might be.  AJAX is 
>>
>>also a problem for
>>
>>>    accessability.  In some cases this is a major problem, 
>>
>>but even when
>>
>>>    it's not it's something we should all think about.  It 
>>
>>also raises the
>>
>>>    level of expertise your app requires to maintain.
>>>
>>>    I'm personally a fan of AJAX.  I've been doing AJAX for 
>>
>>over 5 years
>>
>>>    (keep in mind that AJAX is really more a philosophy and 
>>
>>an approach than
>>
>>>    it is any specific technology... I haven't used 
>>
>>XMLHttpRequest for very
>>
>>>    long, but I accomplished the same types of things in an 
>>
>>app 5 years
>>
>>>    ago).  I believe the age of the "classic" web, where 
>>
>>scripting is
>>
>>>    optional and apps redraw entire screens, is dead.  AJAX 
>>
>>itself is
>>
>>>    nothing knew, but the mindset that accompanies it 
>>
>>largely is, so if
>>
>>>    your
>>>    asking *me* if its a good idea in the first place, I'd 
>>
>>say absolutely
>>
>>>    yes, assuming two things... first, that the way you 
>>
>>want to apply it
>>
>>>    makes sense; anything can be used in a pointless way of 
>>
>>course!, and
>>
>>>    second, that you understand and can accept all the 
>>
>>caveats that go along
>>
>>>    with it.
>>>
>>>    Hope that helps!
>>>
>>>    Frank
>>>
>>>    Sonali Kulkarni wrote:
>>>     > So, does it mean that is it not a good idea to use DWR with
>>>    Struts just as
>>>     > yet?
>>>     >
>>>     > If so, what would be the best way to integrate AJAX 
>>
>>into our Struts
>>
>>>     > application?
>>>     >
>>>     > Ours is a full-blown *financial* banking Struts application.
>>>    Please also let
>>>     > me know if it is a good idea to use AJAX in the first place,
>>>    considering (1)
>>>     > the security risks imposed, especially for a financial
>>>    application (2) ease
>>>     > of integrating AJAX with Struts. (some of the 
>>
>>questions i have,
>>
>>>    for starters
>>>     > are... how do i pass the request object from the 
>>
>>javascript to my
>>
>>>    action
>>>     > class method, ... how do i handle errors returned etc)
>>>     >
>>>     > Thanks for your time! Any replies would be appreciated!
>>>     >
>>>     >
>>>     > On 12/3/05, Frank W. Zammetti < fzlists@omnytex.com
>>>    <ma...@omnytex.com>> wrote:
>>>     >
>>>     >>From the DWR web site:
>>>     >>
>>>     >>http://getahead.ltd.uk/dwr/server/struts
>>>     >>
>>>     >>Just reading through it quickly, that's just about 
>>
>>what I would have
>>
>>>     >>suggested too in terms of separating out core logic 
>>
>>from Actions and
>>
>>>     >>letting your Actions and DWR servlet call them as 
>>
>>needed.  There
>>
>>>    might
>>>     >>be some better approaches, but it sounds like the DWR team is
>>>    looking
>>>     >>for those approaches themselves.
>>>     >>
>>>     >>Frank
>>>     >>
>>>     >>Sonali Kulkarni wrote:
>>>     >>
>>>     >>>Please suggest if there are any good links, or some 
>>
>>working examples
>>
>>>     >>
>>>     >>that
>>>     >>
>>>     >>>explain how Struts could be integrated into the DWR (AJAX)
>>>    framework.
>>>     >>
>>>     >>Any
>>>     >>
>>>     >>>help would be appreciated. There is hardly any 
>>
>>online support or
>>
>>>     >>>documentation.
>>>     >>>
>>>     >>>Thanks!
>>>     >>>
>>>     >>
> 
> ==////==
> 
> --
> Peter Pilgrim :: J2EE Software Development
> Operations/IT - Credit Suisse First Boston, 
> Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom
> Tel: +44-(0)207-883-4497
> 
> 
> ==============================================================================
> Please access the attached hyperlink for an important electronic communications disclaimer: 
> 
> http://www.csfb.com/legal_terms/disclaimer_external_email.shtml
> 
> ==============================================================================
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

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