You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Olivier THIERRY <ol...@gmail.com> on 2007/05/09 14:37:14 UTC

[S2] A bug in documentation for validation

Hi,

I'm not sure this is the right mailing list to talk about it, but I think
there is a bug in the validation documentation on the struts website.
When I open this url :

http://struts.apache.org/2.0.6/docs/basic-validation.html

There's an error in the step 3 so you can't see the end of the page ...
It's the same on every pages in the documentation for validation.

A bit annoying when you try to understand how to validate with Struts 2 :(

Thanks in advance

Olivier

Re: [S2] A bug in documentation for validation

Posted by Torsten Römer <to...@luniks.net>.
Did you also have a look at this one:

http://struts.apache.org/2.x/docs/validating-input.html

It helped me quite a bit.

Torsten

Olivier THIERRY wrote:
> Hi,
> 
> I'm not sure this is the right mailing list to talk about it, but I think
> there is a bug in the validation documentation on the struts website.
> When I open this url :
> 
> http://struts.apache.org/2.0.6/docs/basic-validation.html
> 
> There's an error in the step 3 so you can't see the end of the page ...
> It's the same on every pages in the documentation for validation.
> 
> A bit annoying when you try to understand how to validate with Struts 2 :(
> 
> Thanks in advance
> 
> Olivier
> 

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


Re: [S2] A bug in documentation for validation

Posted by Olivier THIERRY <ol...@gmail.com>.
Thanks Dave ;)

2007/5/28, Dave Newton <ne...@yahoo.com>:
>
> --- Olivier THIERRY <ol...@gmail.com> wrote:
> >
> http://struts.apache.org/2.0.6/docs/basic-validation.html
>
> http://struts.apache.org/2.x/docs/basic-validation.html
>
> d.
>
>
>
>
> ____________________________________________________________________________________Yahoo!
> oneSearch: Finally, mobile search
> that gives answers, not web links.
> http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: & characters are encoded as & in OGNL parameters

Posted by Sami Dalouche <sk...@free.fr>.
Hi,

1] Yes, I can pre-process the value, using something like string
replace... It's just hackish, and I wondered if there were a "right" way
of doing this

2] encode doesn't work; In fact, it seems this parameter only maps to
HttpServletResponse, which only adds the ;jsessionid pseudo-parameter to
the URLs..

Regards,
Sami

Le mardi 29 mai 2007 à 15:35 -0400, Laurie Harper a écrit :
> Sami Dalouche wrote:
> > Hi,
> > 
> >>> Is it possible to disable this behaviour somehow ?
> >> Depends how you're using the URL. Are you sure you even *want* to 
> >> disable the behaviour? Encoding ampersands is generally the right thing 
> >> to do.
> > 
> > Well, yeah, I do want to disable it.
> > Basically, I need to generate the fully qualified (hostname, port,
> > context, action) URL of the current page (with different parameters), so
> > that I can encode it (using URLEncoder), append it to
> > http://maps.google.com/q={myUrl}
> > 
> > The problem is that URLEncoder WILL encoder & correctly, so I don't want
> > struts to process it before I do.
> > 
> > So, is it possible to disable this &amp; encoding ?
> 
> Hmm, well, you haven't described how you're using the url produced with 
> the s:url tag other than 'reusing the url #id in some OGNL parameter'; 
> that's a bit vague. Assuming you're using OGNL to pass the URL value to 
> a method you've written, you can pre/post process the value any way you 
> want.
> 
> The s:url tag has an 'encode' attribute to control whether the URL 
> should be encoded [1], which is true by default. Perhaps all you need is 
> to set that appropriately.
> 
> L.
> 
> [1] http://struts.apache.org/2.x/docs/url.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: & characters are encoded as & in OGNL parameters

Posted by Laurie Harper <la...@holoweb.net>.
Sami Dalouche wrote:
> Hi,
> 
>>> Is it possible to disable this behaviour somehow ?
>> Depends how you're using the URL. Are you sure you even *want* to 
>> disable the behaviour? Encoding ampersands is generally the right thing 
>> to do.
> 
> Well, yeah, I do want to disable it.
> Basically, I need to generate the fully qualified (hostname, port,
> context, action) URL of the current page (with different parameters), so
> that I can encode it (using URLEncoder), append it to
> http://maps.google.com/q={myUrl}
> 
> The problem is that URLEncoder WILL encoder & correctly, so I don't want
> struts to process it before I do.
> 
> So, is it possible to disable this &amp; encoding ?

Hmm, well, you haven't described how you're using the url produced with 
the s:url tag other than 'reusing the url #id in some OGNL parameter'; 
that's a bit vague. Assuming you're using OGNL to pass the URL value to 
a method you've written, you can pre/post process the value any way you 
want.

The s:url tag has an 'encode' attribute to control whether the URL 
should be encoded [1], which is true by default. Perhaps all you need is 
to set that appropriately.

L.

[1] http://struts.apache.org/2.x/docs/url.html


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


Re: & characters are encoded as & in OGNL parameters

Posted by Sami Dalouche <sk...@free.fr>.
Hi,

> > Is it possible to disable this behaviour somehow ?
> 
> Depends how you're using the URL. Are you sure you even *want* to 
> disable the behaviour? Encoding ampersands is generally the right thing 
> to do.
> 

Well, yeah, I do want to disable it.
Basically, I need to generate the fully qualified (hostname, port,
context, action) URL of the current page (with different parameters), so
that I can encode it (using URLEncoder), append it to
http://maps.google.com/q={myUrl}

The problem is that URLEncoder WILL encoder & correctly, so I don't want
struts to process it before I do.

So, is it possible to disable this &amp; encoding ?

Thanks,
Sami Dalouche


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


Re: & characters are encoded as & in OGNL parameters

Posted by Laurie Harper <la...@holoweb.net>.
Sami Dalouche wrote:
> Hi,
> 
> When creating a URL using the Struts2 <s:url id="" /> JSP tag, and then,
> later in the page, reusing the url #id in some OGNL parameter, it seems
> the "&" characters in the URL are encoded as &amp;
> 
> Is this supposed to be a feature or a bug ?

It's expected behaviour.

> Is it possible to disable this behaviour somehow ?

Depends how you're using the URL. Are you sure you even *want* to 
disable the behaviour? Encoding ampersands is generally the right thing 
to do.

L.

ObWhine: please don't post unrelated questions to an existing thread. Be 
sure to start a new thread (with an appropriate subject) by sending a 
fresh message to the list, rather than using Reply To.


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


& characters are encoded as & in OGNL parameters

Posted by Sami Dalouche <sk...@free.fr>.
Hi,

When creating a URL using the Struts2 <s:url id="" /> JSP tag, and then,
later in the page, reusing the url #id in some OGNL parameter, it seems
the "&" characters in the URL are encoded as &amp;

Is this supposed to be a feature or a bug ?
Is it possible to disable this behaviour somehow ?

Thanks for your help,
Sami Dalouche


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


Re: [S2] A bug in documentation for validation

Posted by Dave Newton <ne...@yahoo.com>.
--- Olivier THIERRY <ol...@gmail.com> wrote:
>
http://struts.apache.org/2.0.6/docs/basic-validation.html

http://struts.apache.org/2.x/docs/basic-validation.html

d.



       
____________________________________________________________________________________Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

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


Re: [S2] A bug in documentation for validation

Posted by Olivier THIERRY <ol...@gmail.com>.
Hi,

The problem is still there ...
No way to see the step 3 in Basic Validation documentation.

http://struts.apache.org/2.0.6/docs/basic-validation.html

Thanks

Olivier

2007/5/9, Musachy Barroso <mu...@gmail.com>:
>
> Fixed. It takes a while to replicate to the main doc.
>
> thanks
> musachy
>
> On 5/9/07, Olivier THIERRY <ol...@gmail.com> wrote:
> >
> > Hi,
> >
> > I'm not sure this is the right mailing list to talk about it, but I
> think
> > there is a bug in the validation documentation on the struts website.
> > When I open this url :
> >
> > http://struts.apache.org/2.0.6/docs/basic-validation.html
> >
> > There's an error in the step 3 so you can't see the end of the page ...
> > It's the same on every pages in the documentation for validation.
> >
> > A bit annoying when you try to understand how to validate with Struts 2
> :(
> >
> > Thanks in advance
> >
> > Olivier
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>

Re: [S2] A bug in documentation for validation

Posted by Musachy Barroso <mu...@gmail.com>.
Fixed. It takes a while to replicate to the main doc.

thanks
musachy

On 5/9/07, Olivier THIERRY <ol...@gmail.com> wrote:
>
> Hi,
>
> I'm not sure this is the right mailing list to talk about it, but I think
> there is a bug in the validation documentation on the struts website.
> When I open this url :
>
> http://struts.apache.org/2.0.6/docs/basic-validation.html
>
> There's an error in the step 3 so you can't see the end of the page ...
> It's the same on every pages in the documentation for validation.
>
> A bit annoying when you try to understand how to validate with Struts 2 :(
>
> Thanks in advance
>
> Olivier
>



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