posted 12 years ago
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