Hi,

     i am overriding the struts UI controls for my role based UI rendering.
based on user role i have to decide few attributes of UI component like
editability,visibility etc. for that i have implemented logic required. to
achieve this i am extending TextFieldTag and in the overriding method
doStartTag i am applying the attributes defined for every field.

now the problem is.. when a UI control visibility is false, i want to create
a hidden field instead of rendering the component itself. see the code
snippent..
@override
public int doStartTag() throws JspException {
                ---
                ---
                ---
                if(fieldname==null){
                        super.doStartTag();
                }else if(fieldname!=null &&
fieldManager.getVisibility(fieldname,formAccessMode)){
                        super.doStartTag();
                }else{
                        HiddenTag hiddenTag=new HiddenTag();
                        hiddenTag.setName(name);
                        hiddenTag.setValue(value);
                        hiddenTag.doStartTag();
              }

but hiddenTag.doStartTag() is throwing null pointer exception.


java.lang.NullPointerException
        at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:52)
        at
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:47)

        at
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)


can any one help me ... how to solve this issue? what i am missing here?

Thanks in advance
~Ganesh

Reply via email to