• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

No bean found under attribute key currentMessage

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I am not young enough to know everything. - Oscar Wilde This tiny ad thinks it knows more than Oscar:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic