I would like to know what the replacement is for the altKey and srcKey attributes in the <html:img> tag in Struts 2. What I want to achieve is to be able to insert an image with source path from properties file. Similar to what srcKey does in Struts1. And even for the altertnate text, I want to know how to
Tag: ognl
How to pass the object property as param to Struts custom validator
This is the custom validator, has getters/setters for countryCode How to pass the country code back to the custom validator. This is my ActionClass-validation.xml Address object has zip and countryCode. I want to validate the zip based on the country. When I debug the above code, countryCode has the value ${address.country}. How can I get the country property value? Answer
How to get s:radio with label content as empty
I am using the struts tag s:radio as below; That is generating the HTML output as below; However I don’t want the label content like Yes or No. I am loading an image instead of that. How can I make that label content as blank or null? Answer Use a map to populate a radio tag. The value of the
How to put variable in OGNL tag
In this code questions is a list which contain questions object with In my program, I will make it appears in browser like The list may contain multiple question objects so I made it to show 5 question per page. My problem is (for example) the user may go from page 4 to page 2 and I want to refill
NoSuchMethodError when using submitting form in Struts 2
I’m currently working through the tutorial found on the Apache Struts website. Currently, whenever I press submit on the form, or when I click the Bruce Philips hyperlink, I get a NoSuchMethodError. I’m not too sure what the issue is either and I believe I’ve included everything the tutorial states. I’ve tried including the dependency in my pom.xml, but that