File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

messagesPresent giving NullPointerException

 
Jitesh Sinha
Ranch Hand
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in what cases the logic:messagesPresent will give NullPointerException.I am consistently getting the exception.
Tried to unzar/decompile the tag class file and looked into the code too...but NullPointer seems to be taken care of....
Any pointers will be helpful
 
Corey McGlone
Ranch Hand
Posts: 3271
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mind posting a snippet of the JSP here where you're using it?
 
Jitesh Sinha
Ranch Hand
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The whole portion below is in one Jsp and 2.) follows 1.) immediately

1.)

<logic:messagesPresent message="true">
<html:messages id="msgItem" message="true">
<TR <app:rotateStyle id="msgStyle" classes="messageRow altMessageRow"/>>
<TD><bean:write name="msgItem" filter="false"/></TD>
</TR>
</html:messages>
<TR>
<TD width="500" nowrap><img src="../content/transpixel.gif" width="1" height="7" border="0" alt=""></TD>
</TR>
</logic:messagesPresent>




2.)
<logic:messagesPresent>
<html:messages id="errItem">
<TR <app:rotateStyle id="errStyle" classes="errorMessageRow altErrorMessageRow"/>>
<TD><bean:write name="errItem" filter="false"/></TD>
</TR>
</html:messages>
<TR>
<TD width="500" nowrap><img src="../content/transpixel.gif" width="1" height="7" border="0" alt=""></TD>
</TR>

</logic:messagesPresent>

The tag of 1.) gives problems.If I comment 1.) and leave 2.) as it is,everything goes fine.
[ January 11, 2005: Message edited by: Jitesh Sinha ]
 
Corey McGlone
Ranch Hand
Posts: 3271
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm...do you know which tag is actually causing the exception? Is it the logic:messagesPresent tag or the html:messages tag? What if you were to try something this:



If that works, we know it's the html:messages tag, if not, it's the logic:messagesPresent tag.
[ January 11, 2005: Message edited by: Corey McGlone ]
 
Jitesh Sinha
Ranch Hand
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well,it is messagesPresent Tag only.Since I commented evrything inside the 1st messagesPresent tag and got exception.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic