Spring Java based config Render-Kit and MimeMapper -


i trying use full java based configuration in spring environment primefaces 5.2. want use spark theme , layout. achieved configurations i'm stuck 2 problems.

first (the important 1 :)), need define render kit aso in java config. xml defintion.

<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"               xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"               xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">      <name>primefaces-spark</name>      <component>         <component-type>org.primefaces.component.sparkmenu</component-type>         <component-class>org.primefaces.spark.component.menu.sparkmenu</component-class>     </component>      <render-kit>         <renderer>             <component-family>org.primefaces.component</component-family>             <renderer-type>org.primefaces.component.sparkmenurenderer</renderer-type>             <renderer-class>org.primefaces.spark.component.menu.sparkmenurenderer</renderer-class>         </renderer>     </render-kit>  </faces-config> 

has idea how can set these values in pure java based config? tried find reference list of possible java based configuration properties didn't find 1 :(. live solution can mix java based configuration xml based faces-config.xml workaround. putting in additional faces-config.xml information above web-inf not work. seems need little more :).

second, need define mime types defined in xml this:

<mime-mapping>         <extension>ttf</extension>         <mime-type>application/font-sfnt</mime-type> </mime-mapping> 

this not urgent thing can use workaround putting them web.xml (but prefer doing in pure java config).

i tried use class spring boot (but i'm not programming spring boot environment).

@configuration public class mimemapper implements embeddedservletcontainercustomizer {   @override   public void customize(configurableembeddedservletcontainer container) {     mimemappings mappings = new mimemappings(mimemappings.default);     mappings.add("ttf", "application/font-sfnt");     mappings.add("svg#fontawesomeregular", "image/svg+xml");     container.setmimemappings(mappings);   } } 

but not working, not loaded application (i tried referencing configuration class in abstractannotationconfigdispatcherservletinitializer adding getrootconfigclasses() definition).

thx suggestions,

br,


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -