File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No bean found under attribute key currentMessage

 
Sumanth Singh
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I am getting this Application raised following Error: "No bean found under attribute key currentMessage" error when I click on hyperlink below while iterating through a list in SentMessages.jsp

SentMessages.jsp:
<logic:iterate name="searchMessagesForm" property="pagingOptions.pageObjectsList" id="currentMessage" length="10">
<td>
<a href="searchMessages.do?operation=viewSentMessage&messageId=${currentMessage.messageId}">
<bean:write name="currentMessage" property="subject"/>
</a>

</td>

The data for the row appears. But when i click the hyperlink that is the anchor tag. The control goes into searchMessages action mapping defined in struts-config.xml which directs to SearchMessagesAction class and to the method viewSentMessages() which retrives a list of values from Database based on messageID provided in the anchor tag.

struts-config.xml

<action path="/searchMessages"
type="messages.SearchMessagesAction"
name="searchMessagesForm"
scope="request"
parameter="operation"
validate="false"
>
<forward name="sentMessage" path="/WEB-INF/jsp/SentMessage.jsp"/>
</action>

SearchMessagesAction.java

public ActionForward viewSentMessage(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
try
{
logger.info("Entering 'Sent Messages View' action method");
SearchMessagesForm searchMessagesForm = (SearchMessagesForm) form;

Messages message = MessagesBD.getInstance().findMessagesById(searchMessagesForm.getMessageId());

User currentUser = (User) request.getSession().getAttribute(EdrsConstants.USER);
request.getSession().setAttribute(EdrsConstants.DISPLAY_MODE, "VIEW_SEARCHED_MESSAGE");

logger.info("Exiting 'Sent View Message' action method");
return mapping.findForward("sentMessage");
}
catch (Exception e)
{

ActionMessages errors = new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage("error.detail", e.getMessage()));
saveErrors(request, errors);
return mapping.findForward("ErrorPage");
}
}


As per the mapping in method viewSentMessage should take me to SentMessage.jsp But it takes to Global Error.jsp stating

Application raised following Error: "No bean found under attribute key currentMessage"

Can anyone help me find the solution?

Thanks,
Sumanth
 
Sumanth Singh
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved this problem.

I guess i made it really complicated. It happened because of JSP Syntax errors in SentMessage.jsp hence when trying to open this it was unable to hence it threw this error.

Thanks,
Sumanth
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic