You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by j alex <st...@gmail.com> on 2007/08/28 14:05:49 UTC

S2 Ajax : Static files - what, where?

Hi,

I'm using Websphere and am still stuck with using Ajax for validations ;
since i'm not able to install the right patch etc.

The performance tuning tip says "copy the static content from the Struts 2
jar when using the Ajax theme" . Can someone please give me the steps to do
this ? . I need to know :

1. which files to pick up from the JAR ? - i see there's a "static"
directory

2. Where to drop these files in the webapp?

3. Any changes required to the FTL templates  -- think i can figure it out
based on answers to 1 and 2. Please keep in mind i'm not a js or dojo
expert.

Without this, i'm almost about to drop the idea of using Ajax validations in
my app, and settling for client-side validation alone.

Thanks,
Joseph

Re: S2 Ajax : Static files - what, where?

Posted by Oleg Mikheev <mi...@bigfoot.com>.
j alex wrote:
> If you don't mind can you please paste the <script> includes and directory
> structure where you placed the actual files (in relation to the webapp
> root). I tried going thru the saved HTML output from S2 showcase example and
> got a bunch of js files ; but not able to place them correctly in the webapp
> ; getting upto speed on Dojo concepts will take me some time, and i don't
> have that luxury :-(

You don't have to work with JS files at all
You just put a <script>function....[that I sent]</script>
I was using a Firefox and Firebug w/o which getting the
real HTML output is a nightmare.
All you need to do is to substitute tag <s:text theme='ajax'> with
<input type='text' .....> HTML tag that is generated,
and remove all tables/other layout and add yours.
Then make sure JS function I mentioned work fine with your
layout - meaning they really display and clear errors.

Oleg

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


Re: S2 Ajax : Static files - what, where?

Posted by j alex <st...@gmail.com>.
Oleg,

If you don't mind can you please paste the <script> includes and directory
structure where you placed the actual files (in relation to the webapp
root). I tried going thru the saved HTML output from S2 showcase example and
got a bunch of js files ; but not able to place them correctly in the webapp
; getting upto speed on Dojo concepts will take me some time, and i don't
have that luxury :-(

Thanks,
Joseph



On 8/29/07, j alex <st...@gmail.com> wrote:
>
> I copied over all the FTL files in "simple" theme to a new directory
> "mytheme" and modify the  ones i need to ; don't think this is technically
> extension, but does the job .
>
> -Joseph
>
> On 8/29/07, Oleg Mikheev <mi...@bigfoot.com> wrote:
> >
> > j alex wrote:
> > > Since i cannot use the Ajax/XHTML theme due to UI layout issues , i'm
> > having
> > > a custom theme that extends "simple"  ; i wanted to know if this
> > validation
> > > really depends on having theme="ajax"
> > >
> > > I replaced <s:head theme="ajax" /> with the equivalent javascript
> > includes,
> > > and it seems to work fine ;are there any specific server-side
> > > (Action/interceptors etc.) that rely on the theme being ajax which i
> > may be
> > > missing ?
> >
> > Joseph,
> >
> > I don't think theme effects the server side, it just controls
> > tags HTML output.
> > I also had layout issues with ajax theme, but extending struts 2
> > themes seemed too complicated to me, so I just looked at the HTML
> > output of ajax theme tags and copied them with my changes to JSP.
> > Do you edit freemarker files to extend a theme?
> >
> > Oleg
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: S2 Ajax : Static files - what, where?

Posted by j alex <st...@gmail.com>.
I copied over all the FTL files in "simple" theme to a new directory
"mytheme" and modify the  ones i need to ; don't think this is technically
extension, but does the job .

-Joseph

On 8/29/07, Oleg Mikheev <mi...@bigfoot.com> wrote:
>
> j alex wrote:
> > Since i cannot use the Ajax/XHTML theme due to UI layout issues , i'm
> having
> > a custom theme that extends "simple"  ; i wanted to know if this
> validation
> > really depends on having theme="ajax"
> >
> > I replaced <s:head theme="ajax" /> with the equivalent javascript
> includes,
> > and it seems to work fine ;are there any specific server-side
> > (Action/interceptors etc.) that rely on the theme being ajax which i may
> be
> > missing ?
>
> Joseph,
>
> I don't think theme effects the server side, it just controls
> tags HTML output.
> I also had layout issues with ajax theme, but extending struts 2
> themes seemed too complicated to me, so I just looked at the HTML
> output of ajax theme tags and copied them with my changes to JSP.
> Do you edit freemarker files to extend a theme?
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: S2 Ajax : Static files - what, where?

Posted by Oleg Mikheev <mi...@bigfoot.com>.
j alex wrote:
> Since i cannot use the Ajax/XHTML theme due to UI layout issues , i'm having
> a custom theme that extends "simple"  ; i wanted to know if this validation
> really depends on having theme="ajax"
> 
> I replaced <s:head theme="ajax" /> with the equivalent javascript includes,
> and it seems to work fine ;are there any specific server-side
> (Action/interceptors etc.) that rely on the theme being ajax which i may be
> missing ?

Joseph,

I don't think theme effects the server side, it just controls
tags HTML output.
I also had layout issues with ajax theme, but extending struts 2
themes seemed too complicated to me, so I just looked at the HTML
output of ajax theme tags and copied them with my changes to JSP.
Do you edit freemarker files to extend a theme?

Oleg


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


Re: S2 Ajax : Static files - what, where?

Posted by Musachy Barroso <mu...@gmail.com>.
Nope. All that is tied to the ajax theme is the generation of the
javascript includes by the head tag.

musachy

On 8/28/07, j alex <st...@gmail.com> wrote:
> Thanks Oleg ; i am able to override the validation js functions on the
> showcase example in Tomcat.
>
> Since i cannot use the Ajax/XHTML theme due to UI layout issues , i'm having
> a custom theme that extends "simple"  ; i wanted to know if this validation
> really depends on having theme="ajax"
>
> I replaced <s:head theme="ajax" /> with the equivalent javascript includes,
> and it seems to work fine ;are there any specific server-side
> (Action/interceptors etc.) that rely on the theme being ajax which i may be
> missing ?
>
> -Joseph
>
>
>
>
>
> On 8/28/07, Oleg Mikheev <mi...@bigfoot.com> wrote:
> >
> > j alex wrote:
> > > How can i get some insight into the js functions invoked for Ajax
> > > validation? ; unless i know what they are i cannot override them :-) .
> > > Looking at the example showcase, i only see the <s:head theme="ajax"/>
> > and
> > > seems it does all the magic
> >
> > It does, but to customize it you have to override the ones
> > that I've mentioned.
> > I don't think there is any documentation about that,
> > just my debugging experience.
> >
> > Oleg
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: S2 Ajax : Static files - what, where?

Posted by j alex <st...@gmail.com>.
Thanks Oleg ; i am able to override the validation js functions on the
showcase example in Tomcat.

Since i cannot use the Ajax/XHTML theme due to UI layout issues , i'm having
a custom theme that extends "simple"  ; i wanted to know if this validation
really depends on having theme="ajax"

I replaced <s:head theme="ajax" /> with the equivalent javascript includes,
and it seems to work fine ;are there any specific server-side
(Action/interceptors etc.) that rely on the theme being ajax which i may be
missing ?

-Joseph





On 8/28/07, Oleg Mikheev <mi...@bigfoot.com> wrote:
>
> j alex wrote:
> > How can i get some insight into the js functions invoked for Ajax
> > validation? ; unless i know what they are i cannot override them :-) .
> > Looking at the example showcase, i only see the <s:head theme="ajax"/>
> and
> > seems it does all the magic
>
> It does, but to customize it you have to override the ones
> that I've mentioned.
> I don't think there is any documentation about that,
> just my debugging experience.
>
> Oleg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: S2 Ajax : Static files - what, where?

Posted by Oleg Mikheev <mi...@bigfoot.com>.
j alex wrote:
> How can i get some insight into the js functions invoked for Ajax
> validation? ; unless i know what they are i cannot override them :-) .
> Looking at the example showcase, i only see the <s:head theme="ajax"/> and
> seems it does all the magic

It does, but to customize it you have to override the ones
that I've mentioned.
I don't think there is any documentation about that,
just my debugging experience.

Oleg

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


Re: S2 Ajax : Static files - what, where?

Posted by j alex <st...@gmail.com>.
How can i get some insight into the js functions invoked for Ajax
validation? ; unless i know what they are i cannot override them :-) .
Looking at the example showcase, i only see the <s:head theme="ajax"/> and
seems it does all the magic

On 8/28/07, Oleg Mikheev <mi...@bigfoot.com> wrote:
>
> j alex wrote:
> > i need to customize them in terms of the error message
> > presentation ; and also because i'm using Websphere which is not
> resolving
> > the references from the JAR directly.
>
> Concerning customization - you don't need to edit anything,
> you can just introduce your own JavaScript function
> function addError(e, errorText) {...}
> and it will substitute the one called by validation fw.
>
> Same about
> function clearErrorLabels(form) {...}
> and
> function clearErrorMessages(form) {...}
>
> Concerning WebSphere - this sucks :)
> Is it a known issue with it?
>
> Oleg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: S2 Ajax : Static files - what, where?

Posted by Oleg Mikheev <mi...@bigfoot.com>.
j alex wrote:
> i need to customize them in terms of the error message
> presentation ; and also because i'm using Websphere which is not resolving
> the references from the JAR directly.

Concerning customization - you don't need to edit anything,
you can just introduce your own JavaScript function
function addError(e, errorText) {...}
and it will substitute the one called by validation fw.

Same about
function clearErrorLabels(form) {...}
and
function clearErrorMessages(form) {...}

Concerning WebSphere - this sucks :)
Is it a known issue with it?

Oleg

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


Re: S2 Ajax : Static files - what, where?

Posted by j alex <st...@gmail.com>.
I understand your pt. abt performance,  but my problem is howto get Ajax
working in the first place. The primary reason i need to copy the static
files is because i need to customize them in terms of the error message
presentation ; and also because i'm using Websphere which is not resolving
the references from the JAR directly.

On 8/28/07, Oleg Mikheev <mi...@bigfoot.com> wrote:
>
> j alex wrote:
> > I'm using Websphere and am still stuck with using Ajax for validations ;
> > since i'm not able to install the right patch etc.
> >
> > The performance tuning tip says "copy the static content from the Struts
> 2
> > jar when using the Ajax theme" . Can someone please give me the steps to
> do
> > this ? . I need to know :
>
> Alex,
>
> Please keep in mind that AJAX Validation doesn't effect
> the Performance.
> Performance should be considered with AJAX as a whole,
> and its validation part doesn't take much resources.
>
> Oleg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: S2 Ajax : Static files - what, where?

Posted by Oleg Mikheev <mi...@bigfoot.com>.
j alex wrote:
> I'm using Websphere and am still stuck with using Ajax for validations ;
> since i'm not able to install the right patch etc.
> 
> The performance tuning tip says "copy the static content from the Struts 2
> jar when using the Ajax theme" . Can someone please give me the steps to do
> this ? . I need to know :

Alex,

Please keep in mind that AJAX Validation doesn't effect
the Performance.
Performance should be considered with AJAX as a whole,
and its validation part doesn't take much resources.

Oleg

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