Accessing to an inherited property via OGNL, is possible?

2009-12-17 Thread Cristian Peraferrer
I have a POJO class B that extends the POJO class A.

It is possible to access an inherited property of class A through a
class B object, via OGNL (in a JSP page)?

Thanks,

Cristian

-- 
GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch

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



Re: Accessing to an inherited property via OGNL, is possible?

2009-12-17 Thread Cristian Peraferrer
Ok thank you :-)

I wasn't sure about it because it wasn't working due to another cause,
now I've fixed the other cause and it works.

Cristian

2009/12/17 Paweł Wielgus poulw...@gmail.com:
 Hi Christian,
 b.propertyFromClassA - just like that.

 Best greetings,
 Paweł Wielgus.


 2009/12/17 Cristian Peraferrer corellia...@gmail.com:
 I have a POJO class B that extends the POJO class A.

 It is possible to access an inherited property of class A through a
 class B object, via OGNL (in a JSP page)?

 Thanks,

 Cristian

 --
 GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch

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



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





-- 
GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch

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



Re: struts.i18n.encoding

2009-11-20 Thread Cristian Peraferrer
In my application also used the 'struts.i18.encoding=UTF-8' but I had
the same problem. But I found a way to get it to work.
This way you are only telling struts that has to use UTF-8. But you
also need to tell to your Applications Container
(Tomcat for example) that you want UTF-8.

1. Set the URI encoding of Tomcat's server.xml configuration file. Set
URIEncoding=UTF-8 in your http/https connectors:

!-- Define a non-SSL HTTP/1.1 Connector on port 80 --
Connector URIEncoding=UTF-8 acceptCount=100 connectionTimeout=2
   disableUploadTimeout=true enableLookups=false
   maxHttpHeaderSize=8192 maxSpareThreads=75 maxThreads=150
   minSpareThreads=25 port=80 redirectPort=443/

2. Set a custom filter to configure POST requests use UTF-8:

!-- To get POST requests as UTF-8 --
filter
  filter-nameencodingFilter/filter-name
  filter-classpath.to.your.filter.SetCharacterEncodingFilter/filter-class
  init-param
param-nameencoding/param-name
param-valueUTF-8/param-value
  /init-param
/filter
  filter-mapping
filter-nameencodingFilter/filter-name
url-pattern/*/url-pattern
  /filter-mapping

Tomcat already comes with such an example filter of SetCharacterEncodingFilter.

3. Also in my application's web.xml I have set that JSPs use UTF-8 as a default:

jsp-config
  !-- UTF-8 as the default JSP encoding --
  jsp-property-group
url-pattern*.jsp/url-pattern
page-encodingUTF-8/page-encoding
  /jsp-property-group
/jsp-config

4. In every JSP you I have the following typical meta tag inside head:

  meta http-equiv=Content-Type content=text/html; charset=UTF-8 /

I hope it will help.

Cristian.


On Fri, Nov 20, 2009 at 10:14 AM, carl ballantyne
carl.ballant...@cast-info.es wrote:
 Hi Guys,

 I have an app with form fields and when submitting them to my Struts 2
 actions the values are getting garbled. For example españa becomes
 espa?.

 I think the problem is with Struts because when I create a basic jsp page
 and submit back to itself and display the form field - it works fine.

 I have tried setting struts.i18n.encoding=UTF-8 in the struts.properties
 file and the struts.xml file to no avail. Has anyone used this with success?
 I have searched the forums and it seems to me that people have to resort to
 custom filters to workaround the problem.

 Cheers,
 Carl.


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





-- 
GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch

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



Re: How to check if an iterator is empty inside a s:subset?

2009-11-20 Thread Cristian Peraferrer
Finally I've found that:

s:if test=#attr.myListIterator.hasNext

did the trick. The thing is that I wasn't able to figure out where to
find out var defined objects. Now I know that are accessed trough
#attr.

I hope it will help those people with a similar problem.

Cris

On Thu, Nov 19, 2009 at 1:04 PM, Cristian Peraferrer
corellia...@gmail.com wrote:
 Hi,

 I'm trying to show a There are no items in the list message in my
 application. I'm using a subset the following way:

 s:subset source=myList decider=myDecider var=myListIterator
    s:if test=#myListIterator.hasNext()
    s:iterator status=status
      tr class=s:if test=#status.eveneven/s:ifs:elseodd/s:else
        tds:property value=%{name}//td
        tds:property value=%{type}//td
      /tr
    /s:iterator
    /s:if
    s:else
    tr
      td colspan=2There are no items in the list/td
    /tr
    /s:else
  /s:subset

 But I'm not able to find how to access to the subset iterator... to
 check if the iterator (or the subset list) is empty.

 I'd appreciate any help.

 Thanks,
 Cris

 --
 GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch




-- 
GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch

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



How to check if an iterator is empty inside a s:subset?

2009-11-19 Thread Cristian Peraferrer
Hi,

I'm trying to show a There are no items in the list message in my
application. I'm using a subset the following way:

s:subset source=myList decider=myDecider var=myListIterator
s:if test=#myListIterator.hasNext()
s:iterator status=status
  tr class=s:if test=#status.eveneven/s:ifs:elseodd/s:else
tds:property value=%{name}//td
tds:property value=%{type}//td
  /tr
/s:iterator
/s:if
s:else
tr
  td colspan=2There are no items in the list/td
/tr
/s:else
  /s:subset

But I'm not able to find how to access to the subset iterator... to
check if the iterator (or the subset list) is empty.

I'd appreciate any help.

Thanks,
Cris

-- 
GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch

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



How to integrate a wiki in my struts2 intranet app?

2009-10-07 Thread Cristian Peraferrer
I would like to integrate a wiki into the struts2 app I'm developing.
Any idea which Wiki to use and/or how to integrate one?

Thanks,
Cris

-- 
GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch

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



[s2] Custom field validator with params containing OGNL expression

2009-07-07 Thread Cristian Peraferrer
Hi!

I have implemented a field validator that validates the username is
not already in the database (to avoid overwriting).
But in the validator call (or configuration), I need to pass a
parameter that is another field in the form. Here my code:

field-validator type=usernameavailable
  param name=userId${enterprise.enterpriseId}/param
  messageThis username is already taken./message
/field-validator

The 'userId' is a Long value. I have tested putting a hardcoded long
value (param name=userId34/param) and it worked, but
it doesn't like the OGNL expression. What I'm doing wrong?

Thanks in advance,
Cristian.

-- 
GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch

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



[s2] errorStyleClass equivalent in Struts 2

2009-04-27 Thread Cristian Peraferrer
Hi,

Is there a way in struts2 to point out that there was validation
errors in each input field, like putting an error style using
errorStyleClass (of struts1)?

struts1 example:

html:password property=password styleId=password
errorStyleClass=frmError/

Thanks,
Cris.

-- 
GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch

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



Re: Aw: [s2] Using UTF-8 in .properties files

2009-04-13 Thread Cristian Peraferrer

Thank you very much, I think it resolves my problem :)

Cristian.

On 09/04/2009, at 12:28, Paweł Wielgus wrote:


Hi all,
try this:
http://sourceforge.net/projects/eclipse-rbe/

Best greetings,
Paweł Wielgus.


2009/4/9 Cristian Peraferrer corellia...@gmail.com:
So, is it possible to *really* develop internationalized struts web  
apps?
How can I add chinese or japanese, if the way to internationalize  
it isn't

capable to use other encoding than ASCII? I can't understand that.

Any idea?

Thanks,
Cristian.

On 09/04/2009, at 11:39, kindl...@arcor.de wrote:


If you look in the Java docs, you will see this is not possible.
.properties files are always ASCII. The only possibility to include
non-ASCII characters is using the Unicode codes \u. I do hate  
this.


There might be a way to extend the resource bundle framework to  
support
files using other encodings, but I never found a ready-to-use  
package and

writing it myself was never worthwhile.

Martin


- Original Nachricht 
Von: Cristian Peraferrer corellia...@gmail.com
An:  user@struts.apache.org
Datum:   09.04.2009 11:28
Betreff: [s2] Using UTF-8 in .properties files


Hi,

How I can use UTF-8 in the .properties files? (I need  
the .properties

files for i18n, so loggically I will need characters other than the
contained in ASCII or latin1).

Thanks,
Cristian.

--
GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch


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




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



--
GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch


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




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



--
GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch


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



[s2] Using UTF-8 in .properties files

2009-04-09 Thread Cristian Peraferrer

Hi,

How I can use UTF-8 in the .properties files? (I need the .properties  
files for i18n, so loggically I will need characters other than the  
contained in ASCII or latin1).


Thanks,
Cristian.

--
GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch


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



Re: Aw: [s2] Using UTF-8 in .properties files

2009-04-09 Thread Cristian Peraferrer
So, is it possible to *really* develop internationalized struts web  
apps? How can I add chinese or japanese, if the way to  
internationalize it isn't capable to use other encoding than ASCII? I  
can't understand that.


Any idea?

Thanks,
Cristian.

On 09/04/2009, at 11:39, kindl...@arcor.de wrote:

If you look in the Java docs, you will see this is not  
possible. .properties files are always ASCII. The only possibility  
to include non-ASCII characters is using the Unicode codes \u. I  
do hate this.


There might be a way to extend the resource bundle framework to  
support files using other encodings, but I never found a ready-to- 
use package and writing it myself was never worthwhile.


Martin


- Original Nachricht 
Von: Cristian Peraferrer corellia...@gmail.com
An:  user@struts.apache.org
Datum:   09.04.2009 11:28
Betreff: [s2] Using UTF-8 in .properties files


Hi,

How I can use UTF-8 in the .properties files? (I need the .properties
files for i18n, so loggically I will need characters other than the
contained in ASCII or latin1).

Thanks,
Cristian.

--
GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch


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




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



--
GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch


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



Empty lines before doctype declaration

2009-04-06 Thread Cristian Peraferrer
I'm using struts 2.1.6, using JSP's with Tiles plugin, and I'm getting  
empty lines before the doctype, but in my JSP's there aren't spaces.  
Where I should look at?


Thanks,
Cristian.

--
GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch


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



Re: Empty lines before doctype declaration

2009-04-06 Thread Cristian Peraferrer
I have seen that the problem wasn't related with UTF-8 nor the XML  
parser.

It is about JSP configuration, I have put the following in my web.xml:

!-- Avoid unwanted newlines and spaces --
jsp-config
 jsp-property-group
   url-pattern*.jsp/url-pattern
   trim-directive-whitespacestrue/trim-directive-whitespaces
 /jsp-property-group
/jsp-config

This solved my problem.

On 06/04/2009, at 13:14, Cristian Peraferrer wrote:

I'm using struts 2.1.6, using JSP's with Tiles plugin, and I'm  
getting empty lines before the doctype, but in my JSP's there aren't  
spaces. Where I should look at?


Thanks,
Cristian.

--
GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch



--
GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch


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