Struts2 passing variables case

but Struts2 cannot receive this kind of camelcase style (just first one char lower and second upper case) This is actually not true. Struts2 can receive any variable name that comply JavaBeans spec. But apart from the Java implementation of this spec. (if you want to learn more about JavaBeans, see this post What is … Read more

How to use parameters, request and session objects present in ActionContext?

In Struts2, Session Map and Request Map are wrappers for the underlying HttpServletRequest and Session objects. If you only need to access attributes, use the wrappers. Use ActionContext to get them (both the wrappers and the underlying HTTP objects) only if you are inside an Interceptor or a POJO. If you are inside an Action, … Read more

Struts2 .action extension causing CSS, JavaScript and Struts Dojo to break

Try to use struts action exstension with comma like this <constant name=”struts.action.extension” value=”,”/>. From the struts2 properties file: Used by the DefaultActionMapper You may provide a comma separated list, e.g. struts.action.extension=action,jnlp,do The blank extension allows you to match directory listings as well as pure action names without interfering with static resources, which can be specified … Read more

What’s the difference between # , % and $ signs in Struts tags?

Use of # (pound sign) OGNL is used to refer to objects in the ActionContext as follows: objectName: object in the ValueStack (default/root object in the OGNL context), such as an Action property #objectName: object in the ActionContext but outside of the ValueStack, specifically… #objectName: ActionContext object that has been created using the Struts2 data … Read more

Why are Bootstrap’s form elements rendered terribly with Struts2-Boostrap-Plugin?

Struts2 uses Themes to generate HTML from Tags: a different theme chosen, a different HTML in output. The default theme is XHTML, that generates <td>, <label> and other stuff around your elements. Usually, I recommend to use the simple theme, that generates almost no additional code, and that would make your code work as-is. Put … Read more