You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by da...@adw.es on 2008/07/14 17:53:44 UTC

message resources ???key??? displaying

Hi, I´m developing a project with Struts 1.2. When  trying to display <html:errors> in a jsp page, the errors saved in SaveMessages are displayed, but not correctly, for example:

in showerrors.jsp:
???es.error.wrong.password??? 

instead of:
Your password is wrong.

The ApplicationResources.properties file is properly mapped with its keys. 
error.wrong.password = Your password is wrong

Figure out that a "es." is displayed while no Locale configuration has been setup.

What should I check? Any ideas will be welcomed.

Thanks,

Re: S2: web.xml servlet/filter-mappings

Posted by "Alberto A. Flores" <aa...@gmail.com>.
Also, please remember that the order of the <filter-mapping> in web.xml 
is VERY important.

Don Brown wrote:
> Could you post more information?  Struts should only be responding to
> URI's that contain configured extensions via the
> struts.action.extension setting, which defaults to "action".
> 
> Don
> 
> On Tue, Jul 15, 2008 at 7:01 PM, Mikkel Lindhard <ml...@gmail.com> wrote:
>> Hello list
>>
>> I have an web-application which use both Struts 2 and Axis 2.
>>
>> Before struts 2.1 i didn't have a problem using the following configuration
>> in web-xml
>>
>>        <servlet-mapping>
>>                <servlet-name>AxisServlet</servlet-name>
>>                <url-pattern>/services/*</url-pattern>
>>        </servlet-mapping>
>>
>>        <filter-mapping>
>>                <filter-name>struts2</filter-name>
>>                <url-pattern>/*</url-pattern>
>>        </filter-mapping>
>>
>> The problem with Struts2.1.x is that the /service/xxx calls are taken over
>> by the struts filter even though it doesnt have a mapping for it.
>>
>> is there a way i can configure struts to not handle the request if the
>> mapping doesnt exist?
>>
>> Or might there be another solution? :)
>>
>> Thanks in advance.
>>
>> Mikkel
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 

-- 

Alberto A. Flores
http://www.linkedin.com/in/aflores



Re: S2: web.xml servlet/filter-mappings

Posted by Don Brown <do...@gmail.com>.
Could you post more information?  Struts should only be responding to
URI's that contain configured extensions via the
struts.action.extension setting, which defaults to "action".

Don

On Tue, Jul 15, 2008 at 7:01 PM, Mikkel Lindhard <ml...@gmail.com> wrote:
> Hello list
>
> I have an web-application which use both Struts 2 and Axis 2.
>
> Before struts 2.1 i didn't have a problem using the following configuration
> in web-xml
>
>        <servlet-mapping>
>                <servlet-name>AxisServlet</servlet-name>
>                <url-pattern>/services/*</url-pattern>
>        </servlet-mapping>
>
>        <filter-mapping>
>                <filter-name>struts2</filter-name>
>                <url-pattern>/*</url-pattern>
>        </filter-mapping>
>
> The problem with Struts2.1.x is that the /service/xxx calls are taken over
> by the struts filter even though it doesnt have a mapping for it.
>
> is there a way i can configure struts to not handle the request if the
> mapping doesnt exist?
>
> Or might there be another solution? :)
>
> Thanks in advance.
>
> Mikkel
>
>
> ---------------------------------------------------------------------
> 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


S2: web.xml servlet/filter-mappings

Posted by Mikkel Lindhard <ml...@gmail.com>.
Hello list

I have an web-application which use both Struts 2 and Axis 2.

Before struts 2.1 i didn't have a problem using the following  
configuration in web-xml

     	<servlet-mapping>
         	<servlet-name>AxisServlet</servlet-name>
         	<url-pattern>/services/*</url-pattern>
     	</servlet-mapping>

	<filter-mapping>
         	<filter-name>struts2</filter-name>
         	<url-pattern>/*</url-pattern>
     	</filter-mapping>

The problem with Struts2.1.x is that the /service/xxx calls are taken  
over by the struts filter even though it doesnt have a mapping for it.

is there a way i can configure struts to not handle the request if the  
mapping doesnt exist?

Or might there be another solution? :)

Thanks in advance.

Mikkel


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


Re: messages_(locale).properties

Posted by Lukasz Lenart <lu...@googlemail.com>.
Hi,

To specify custom file names for your messages, add them to
struts.properties [1], just the main name, without lang suffix

struts.custom.i18n.resources=messages, somemessages

You should always have default messages.properties bundle, move
messages_en.properties to messages.properties for example.

[1] http://struts.apache.org/2.1.2/docs/strutsproperties.html


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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


messages_(locale).properties

Posted by Jishnu Viswanath <ji...@tavant.com>.
Hi all,
	Can any one tell me where do I specify that I want to use
messages_en.properties or messages_de.properties?

By the way I am using struts 2.

And one more thing, does browser any intention that it's DE or EN?

Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE

	
Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may 
contain confidential and/or privileged material. If you have received this in error, please contact the 
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies 
may be subject to our monitoring procedures.


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


Re: message resources ???key??? displaying

Posted by da...@adw.es.
Hi,

That was the correct path, I didn´t know about it.
Thank you for your answers, guys. ;-)


----- Original Message ----- 
From: "Lukasz Lenart" <lu...@googlemail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, July 14, 2008 8:22 PM
Subject: Re: message resources ???key??? displaying


>> The ApplicationResources.properties file  is under:
>> proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties
>
> Move to the /WEB-INF/classes
>
>
> Regards
> -- 
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> Email procesado por MailFoundry
> 


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


Re: message resources ???key??? displaying

Posted by Lukasz Lenart <lu...@googlemail.com>.
> The ApplicationResources.properties file  is under:
> proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties

Move to the /WEB-INF/classes


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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


Re: message resources ???key??? displaying

Posted by "Dante A. Castiglione Maldonado" <da...@gmail.com>.
I got the same problem a few moments ago

I put the ApplicationResources.properties file under WEB-INF/classes
and it worked ok


2008/7/14  <da...@adw.es>:
> It is configured as:
>
> struts-config.xml
> <message-resources parameter="ApplicationResources" null="false" />
>
> In web.xml is not defined.
>
> The ApplicationResources.properties file  is under:
> proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties
>
> And the jsp code:
>
> <logic:messagesPresent message="true">
> <html:messages id="msgs" message="true">
> <bean:write name="msgs"/>
> </html:messages >
> </logic:messagesPresent >
>
> Is something wrong about the path/classpath? Do I  need to add a key to
> <message-resources parameter="ApplicationResources".. key="whatever">??
>
> Regards,
>
>
> ----- Original Message ----- From: "Lukasz Lenart"
> <lu...@googlemail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Monday, July 14, 2008 6:32 PM
> Subject: Re: message resources ???key??? displaying
>
>
>> Hi,
>>
>> How did you configure the messages in struts-config? It should be
>> something like this:
>>
>> <message-resources parameter="MessageResources"/>
>>
>>
>> Regards
>> --
>> Lukasz
>> http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>> Email procesado por MailFoundry
>>
>
>
> ---------------------------------------------------------------------
> 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: message resources ???key??? displaying

Posted by da...@adw.es.
It is configured as:

struts-config.xml
<message-resources parameter="ApplicationResources" null="false" />

In web.xml is not defined.

The ApplicationResources.properties file  is under:
proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties

And the jsp code:

<logic:messagesPresent message="true">
<html:messages id="msgs" message="true">
<bean:write name="msgs"/>
</html:messages >
</logic:messagesPresent >

Is something wrong about the path/classpath? Do I  need to add a key to 
<message-resources parameter="ApplicationResources".. key="whatever">??

Regards,


----- Original Message ----- 
From: "Lukasz Lenart" <lu...@googlemail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, July 14, 2008 6:32 PM
Subject: Re: message resources ???key??? displaying


> Hi,
>
> How did you configure the messages in struts-config? It should be
> something like this:
>
> <message-resources parameter="MessageResources"/>
>
>
> Regards
> -- 
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> Email procesado por MailFoundry
> 


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


Re: message resources ???key??? displaying

Posted by Lukasz Lenart <lu...@googlemail.com>.
Hi,

How did you configure the messages in struts-config? It should be
something like this:

<message-resources parameter="MessageResources"/>


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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