Almost gut

your action is in:
src/main/java/lab_struts/tutorial/message_resource/action

but the related properties file in:
src/main/resources/lab_struts/tutorial/message_resource/

so they differ on the last part - "action" and that's why message
cannot be found. You have two options here:
- rename Register.properties to package.properties then it will be
used for all actions in this package and below
- create subdirectory "action" and move Register.properties there

It's explained here
http://struts.apache.org/docs/localization.html


2015-03-11 21:58 GMT+01:00 Jeanderson <jeanderso...@gmail.com>:
> Hello Lukasz Lenart,
>
> Thank you for your message. I imagined that working with a directory tree
> generated by Eclipse could be a problem.
> I started a new project based on Maven [1], however, if you run my code,
> you will get again a warning:
>
> "
> 2015-03-11 17:48:00,316  WARN
> (com.opensymphony.xwork2.util.LocalizedTextUtil:64) - Missing key
> [formBean.firstName] in bundles [[org/apache/struts2/struts-messages,
> com/opensymphony/xwork2/xwork-messages]]!
> 2015-03-11 17:48:00,340  WARN
> (org.apache.struts2.components.ServletUrlRenderer:60) - No configuration
> found for the specified action: 'register' in namespace: ''. Form action
> defaulting to 'action' attribute's literal value.
> "
>
> It is not clear for me what is wrong, it is like the framework can't find
> the properties files for some reason.
> Any idea of what am I missing?
>
> [1]
> https://github.com/jeandersonbc/labs-struts2/tree/hotfix/tutorial/message_resource
>
> Best regards,
> Jeanderson Barros Cândido
> http://jeandersonbc.github.io
>
> 2015-03-11 16:10 GMT-03:00 Lukasz Lenart <lukaszlen...@apache.org>:
>
>> 2015-03-11 18:09 GMT+01:00 Jeanderson <jeanderso...@gmail.com>:
>> > Hi everyone,
>> >
>> > I am a beginner in Struts 2 and so far, I've been working with the
>> official
>> > tutorials to get started with the framework. Also, I'm using Eclipse.
>> >
>> > In the "Message Resource Files" [1], the framework can't find the key
>> > located in the .properties file although it is placed in the same package
>> > of its related action class.
>> >
>> > Since I'm using Eclipse to create every Struts 2 project and knowing that
>> > Struts 2 is a "convention over configuration" framework, I wonder if I'm
>> > having this problem because the generated directory tree is not the same
>> as
>> > the one created using Maven.
>> >
>> > Is there any recommended way to start a Struts 2 project? My code is
>> hosted
>> > at Github [2] and maybe someone could give me a hint of what is wrong
>> with
>> > it. I did everything as suggested in the tutorial and that's why I
>> believe
>> > the issue is having a different directory tree.
>> >
>> > [1] http://struts.apache.org/docs/message-resource-files.html
>> > [2]
>> >
>> https://github.com/jeandersonbc/labs-struts2/tree/master/tutorial/message_resource
>>
>> Your project [2] is a bit messy, you're using Maven (pom.xml) but you
>> don't follow standard layout structure for Maven projects. If you want
>> to use Maven to build your Struts2 project it's far better to start
>> with Maven Archetypes, read this
>>
>>
>> http://struts.apache.org/docs/struts-2-maven-archetypes.html#Struts2MavenArchetypes-Quickstart
>>
>> and basically use this
>>
>> mvn archetype:generate -DarchetypeCatalog=http://struts.apache.org/
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> 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

Reply via email to