struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juan-Francisco Diez (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4358) Bad properties file not detected
Date Mon, 09 Jun 2014 10:21:02 GMT

    [ https://issues.apache.org/jira/browse/WW-4358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14021860#comment-14021860
] 

Juan-Francisco Diez commented on WW-4358:
-----------------------------------------

Imagine that you have the following global properties file:

message=<p>This is my message<\p> \
                 with two lines
message2=Another mesage

Obviously you have an error in the p tag (the backslash is considered as a new line token).
That's causes struts to not put in the ValueStack this properties file and the i18n interceptor
can't replace any of your keys from that properties file in your views.

If you have a huge properties files, it's very hard to find out where you made the mistake.

Somewhere in the process where struts put the properties file in the ValueStack, you can handle
an exception with a log reference to advice the developper that the file can't be push to
the ValueStack. I think that the log must be a DEBUG log wich appears when the debug mode
is enabled.

> Bad properties file not detected
> --------------------------------
>
>                 Key: WW-4358
>                 URL: https://issues.apache.org/jira/browse/WW-4358
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Other, Value Stack
>    Affects Versions: 2.3.14, 2.3.16.2
>         Environment: Tomcat7, Ubuntu Server 14.04 LTS
>            Reporter: Juan-Francisco Diez
>            Priority: Minor
>              Labels: easyfix
>             Fix For: 2.5
>
>
> I had a problem in a properties file but the framework never warned me.
> The properties file was the default configured in struts.xml for i18n but the strings
never appear and the log said that there were no key defined.
> The problem was just a mismatch between a slash and a backslash in the properties file
but I spent lot of time to track the problem (about 8 hours probing lot of stuffs).
> I just see that the properties file was not in the ValueStack. Perhaps if struts can't
push the content of the properties file in the ValueStack, it  can put an advise in the log
of the container.
> I think that a framework like Struts must help developpers to find quicker the problems
and in this case it's not helping.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message