Yes. This is one of those weird cases. We have three choices:

1. Duplicate the message key in both places
2. Remove the fmt:message tags in InfoContent.jsp and PageTab.jsp (the
ones that reference common.nopage) and refactor their functions into
the ActionBean handler methods
3. Rename the key that WikiPageTypeConverter relies on, or figure out
a way to eliminate the reference.

At the moment (1) is the best option because it is the simplest; I'm
also investigating (3). But when we encounter stuff like this we need
to figure out if we can reduce duplication when possible on a
case-by-case basis.

Could you try the BundleMigrator tool to do this? The command...

"java -cp build/JSPWiki.jar com.ecyrd.jspwiki.ui.migrator.BundleMigrator"

...should work.

Note: there is one bug in BundleMigrator that I'm still trying to
solve, related to output file encoding. If you've got any insights on
how to solve it, let me know... I'll be looking at this
tonight/tomorrow.

On Wed, Jan 28, 2009 at 12:04 PM, Harry Metske <[email protected]> wrote:
> Andrew,
>
> nice, during of the tests last week I stumbled into missing resource
> common.nopage :
>
> 2009-01-26 21:51:15,780 [http-8080-6] ERROR
> com.ecyrd.jspwiki.tags.WikiTagBase  - Tag failed
> java.util.MissingResourceException: Could not find an error message with
> key: common.nopage
>        at
> net.sourceforge.stripes.validation.LocalizableError.getMessageTemplate(LocalizableError.java:109)
>        at
> net.sourceforge.stripes.action.SimpleMessage.getMessage(SimpleMessage.java:91)
>        at
> net.sourceforge.stripes.validation.SimpleError.getMessage(SimpleError.java:102)
>        at
> com.ecyrd.jspwiki.tags.MessagesTag.doWikiStartTag(MessagesTag.java:117)
>        at
> com.ecyrd.jspwiki.tags.WikiTagBase.doStartTag(WikiTagBase.java:119)
>        at
> org.apache.jspwiki.jsp.templates.default_.AttachmentTab_jsp._jspx_meth_wiki_Messages_0(Unknown
> Source)
>        at
> org.apache.jspwiki.jsp.templates.default_.AttachmentTab_jsp._jspService(Unknown
> Source)
>        at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> ................
>
> I read the whole discussion on resourcebundles in
> https://issues.apache.org/jira/browse/JSPWIKI-351 .
>
> The common.nopage is currently in default.properties, but is used in both
> stripes messages, as in plain JSP's, what to do with that ?
>
> regards,
> Harry
>
> 2009/1/27 Andrew Jaquith <[email protected]>
>
>> All --
>>
>> In the process of writing the BundleMigrator tool, I discovered a
>> serious logic flaw in the CommentedProperties class.
>> CommentedProperties reads/writes Properties files while preserving
>> comments. As currently written, it doesn't correctly parse property
>> values that span multiple lines. So, I am re-writing it. It's actually
>> a pretty hard thing to re-write: the original version took some
>> shortcuts that, as it turned out, didn't work out so well.
>>
>> Anyway, I thought I'd let everybody, especially Harry, know what's
>> going on. It's blocking me from finishing BundleMigrator, and thus
>> from doing more JSP migration work -- so I wanted to get it solved.
>>
>> Andrew
>>
>

Reply via email to