Struts ActionMapping passed to Action is null
Not worked out why or how this can happen but in one of my Action classes, the Struts framework decided to pass my Action a null ActionMapping reference.
Read More »Not worked out why or how this can happen but in one of my Action classes, the Struts framework decided to pass my Action a null ActionMapping reference.
Read More »In struts you can define a global exception handler which is used as a catch all so you can display some meaningful page to the users. The path definition must be a path to a page and not a struts action or tiles definition path. When you think about this it makes sense otherwise you […]
Read More »I came across this strange error, which baffled me for ages, but was simple to fix. I had duplicate resource references in web.xml and binding files. com.ibm.ws.exception.RuntimeError at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:328) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:268) at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536) at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413) at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:152) at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536) at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413) at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:287) at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
Read More »In the MANIFEST.MF file in the ear, you will need to set the follwing property Implementation-Version: 4.23.0.1 In ANT you can use this <manifest file=”MANIFEST.MF”> <attribute name=”Implementation-Version” value=”${version} ${TODAY}”/> </manifest> If you use Hudson/Jenkins, then you can place the build version from Hudson/Jenkins with this <manifest file=”MANIFEST.MF”> <attribute name=”Implementation-Version” value=”${BUILD_NUMBER}”/> </manifest>
Read More »Create your messages_en.properties with your messages as a key value pair greeting_hello=Hello {0} Now in code use the following ResourceBundle resourceBundle= PropertyResourceBundle.getBundle(“messages_en.properties”); String message = resourceBundle.getString(“greeting_hello”); MessageFormat messageFormat = new MessageFormat(message); String formattedMessage = messageFormat.format(“Markzi”); System.out.println(formattedMessage); This will print out Hello Markzi
Read More »Came across this when trying to parse a time. DateFormat timeFormat = DateFormat.getTimeInstance(); timeFormat.parse(“11:23:00”): Caused by: java.text.ParseException: Unparseable date: “11:23:00” at java.text.DateFormat.parse(DateFormat.java:347) Solution was a simple one. Set the style and locale on the DateFormat DateFormat timeFormat = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.UK); timeFormat.parse(“11:23:00”):
Read More »