my dog learned polymorphism*
The moose likes Struts and the fly likes messagesPresent giving NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "messagesPresent giving NullPointerException" Watch "messagesPresent giving NullPointerException" New topic
Author

messagesPresent giving NullPointerException

Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 145
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

Joined: Dec 20, 2001
Posts: 3271
Mind posting a snippet of the JSP here where you're using it?


SCJP Tipline, etc.
Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 145
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

Joined: Dec 20, 2001
Posts: 3271
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

Joined: Jun 19, 2004
Posts: 145
Well,it is messagesPresent Tag only.Since I commented evrything inside the 1st messagesPresent tag and got exception.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: messagesPresent giving NullPointerException
 
Similar Threads
Clarify... Math Functions....
confusion in transient
WA #2 ..... word association
Scrabble... it only takes a minute...
what is mean by Encapsulation in OOPS?