I'm trying to find a way around this issue at this point and think it should be fixed in the next release.
Currently the HomeMenu registers itself with the URL "" as seen below:
This works fine if you are mapping the dispatcher servlet to root "/"; however, if you follow the guidelines for changing the default mapping (to lets say "/batch") which involves updating the web.xml servlet-mappingCode:public HomeMenu() { super("", "Home", Integer.MIN_VALUE); }
and then overriding the resourceServiceCode:<servlet-mapping> <servlet-name>Batch Servlet</servlet-name> <url-pattern>/batch/*</url-pattern> </servlet-mapping>
the Home link stops working because the code will concat the prefix and url resulting in "/batch". If I change the servletPath in resource service to "/batch/" the Home link works again but the rest break because you end up with urls like "/batch//jobs".Code:<bean id="resourceService" class="org.springframework.batch.admin.web.resources.DefaultResourceService"> <property name="servletPath" value="/batch"/> </bean>
Long story short, HomeMenu should really pass "/" to BaseMenu or more accurately "/home".
Finally, to my question. Is there an easy way to override the HomeMenu bean to use "/home" instead until the code is updated? It doesn't have an id defined for it in the manager-context.xml so I'm not sure how
I've thought about overriding the menuManager itself and manually grabbing the HomeMenu after its been injected but hate hacks like that. If anyone has another idea, please let me know. Thanks!Code:<bean class="org.springframework.batch.admin.web.HomeMenu" parent="baseMenu"/> <bean class="org.springframework.batch.admin.web.JobsMenu" parent="baseMenu"/> <bean class="org.springframework.batch.admin.web.ExecutionsMenu" parent="baseMenu"/> <bean class="org.springframework.batch.admin.web.FilesMenu" parent="baseMenu"/>![]()


Reply With Quote
