You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Juergen Donnerstag (JIRA)" <ji...@apache.org> on 2008/08/24 09:25:44 UTC

[jira] Resolved: (WICKET-1796) When markup type is XML, getLocalizer().getString( "xyz", (WebPage) ) throws Exception

     [ https://issues.apache.org/jira/browse/WICKET-1796?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Donnerstag resolved WICKET-1796.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4-M4

Please see below for an example on how to configure another file extension for xml properties files. E.g. by changing it to "xmlProperties" any conflicts can be avoided.

	/**
	 * @throws Exception
	 */
	public void testRenderHomePage_3() throws Exception
	{
		IPropertiesFactory myFac = new MyPropertiesFactory(tester.getApplication());
		tester.getApplication().getResourceSettings().setPropertiesFactory(myFac);

		executeTest(XmlPage_3.class, "XmlPageExpectedResult_3.xml");
	}

	/**
	 * 
	 */
	private class MyPropertiesFactory extends PropertiesFactory
	{
		/**
		 * Construct.
		 * 
		 * @param application
		 */
		public MyPropertiesFactory(Application application)
		{
			super(application);

			getPropertiesLoaders().clear();
			getPropertiesLoaders().add(new PropertiesFilePropertiesLoader());
			getPropertiesLoaders().add(new XmlFilePropertiesLoader("xmlProperties"));
		}
	}


> When markup type is XML, getLocalizer().getString( "xyz", (WebPage) ) throws Exception
> --------------------------------------------------------------------------------------
>
>                 Key: WICKET-1796
>                 URL: https://issues.apache.org/jira/browse/WICKET-1796
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: n/a
>            Reporter: Sebastian Gooren
>             Fix For: 1.4-M4
>
>
> When using
> @Override
>     public String getMarkupType()
>     {
>         return "xml";
>     }
> in a webpage, I cannot use getLocalizer().getString( "xyz", this ) anymore. I traced it back to
> Caused by: org.xml.sax.SAXParseException: Document root element "order", must match DOCTYPE root "null".
> Apparently, the wicket localizer (org.apache.wicket.resource.loader.ComponentStringResourceLoader.loadStringResource, line 142) decides to look for an XML properties file. Normally, this would be ok. But now, since I have an XML file in place which is the markup for the webpage, localization breaks. Wicket thinks that my markup file is an XML properties file.
> Right now it's either XML markup and no localization for that page, or HTML markup.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.