Hello,
We have a requirement where input controls of the screens are customizable. For each screen label, there is a entry in the database which decides what type of control(input box, radio, textarea, listbox etc.) would be displayed for the label. To avoid writing if else blocks in the JSP and to reuse the code, I have created a java bean method which returns HTML code based on the display type passed. Something like this
public String getControl(string displayType,String id)
{
if(displayType.equals("TEXT"))
return "<html:text property=id>";
else if(displayType.equals("TEXTAREA"))
return "<html:textarea property=id>";
and so on.......
}
in the jsp......I do
out.println(bean.getControl(displayType,id));
Issue is HTML code returned by bean is treated as normal string and struts HTML tags are not executed by the server. When the page is displayed, it does not show any input controls....if I do "View Source" I can see <html:text property=id> is a part of HTML.
How do I force JSP engine to resolve these tags? Any other solution to achieve such requirement? Please advice.
- Anirudha