struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hermann.x....@jpmchase.com
Subject Re: javax.servlet.jsp.JspException: Cannot find bean under name
Date Tue, 03 Mar 2009 18:02:09 GMT
I took a look at an older version of the code (which works perfectly) and 
noticed something.  After clicking the submit button, it executes the 
/searchInventory action which then forwards to noResults.jsp... but it is 
not doing that in the newer version of the code.  In the newer version of 
the code, index.jsp is rendered fine initially then when the submit button 
is clicked, it attempts to load the index.jsp again and thats when the 
exception occurs.  If I can get it to properly execute the 
/searchInventory action, I think this won't be an issue.

The only difference between the new and old version is that the old 
version is using the IBM API w/ Struts while the newer one is using JSR 
168 w/ Struts.  I haven't changed any of the logic in the code... just 
several tags and the usual modifications to portlet.xml and web.xml that 
is necessary when doing IBM API to JSR 168 conversions...
Perhaps there is something wrong with my struts-config or the form in 
index.jsp?  I will continue to do more research on my own but let me know 
if you can find anything.

Thanks!

<action name="requestFormBean" path="/searchInventory" scope="session" 
type="com.chase.adf.cpcinventory.actions.SearchInventoryAction">
                        <forward name="success" path="/result.jsp">
                        </forward>
                        <forward contextRelative="false" name="failure" 
path="/failure.jsp">
                        </forward>
                        <forward contextRelative="false" name=
"noResultsFound" path="/noResults.jsp">
                        </forward>
                        <forward contextRelative="false" name=
"multipleResultsFound" path="/summaryResults.jsp">
                        </forward>
                </action>


<div align="center"><html:form focus="stock_id"
        action="/searchInventory">
        <TABLE border="0">
                <TBODY>
                        <TR>
                                <TH>Location</TH>
                                <TD><html:select property="location" size=
"1"
                                        styleId="location">
                                        <html:options collection=
"locationList" property="name" />
                                </html:select></TD>
                        </TR>
                        <TR>
                                <TH>Client Id</TH>
                                <TD><html:select property="client_id" size
="1">
                                        <html:options collection=
"clientList" property="name" />
                                </html:select></TD>
                        </TR>
                        <TR>
                                <TH>Stock Id</TH>
                                <TD><html:text property="stock_id" styleId
="field1"
                                        onfocus="field1.select()" onblur=
"setFocus()" /></TD>
                        </TR>
                        <TR>
                                <TD><html:submit property="submit" value=
"Submit" /></TD>
                                <TD><html:reset /></TD>
                        </TR>
                </TBODY>
        </TABLE>
        <BR></BR>
</html:form></div>



Nils-Helge Garli Hegvik <nilsga@gmail.com> 
03/03/2009 12:31 PM
Please respond to
"Struts Users Mailing List" <user@struts.apache.org>


To
Struts Users Mailing List <user@struts.apache.org>
cc

Subject
Re: javax.servlet.jsp.JspException: Cannot find bean under name






Well, it was more like a question really... You say you get the error
message in index.jsp. Yet you say that it only occurs when you press
the submit button? Are you sure that it's this portlet that is causing
the problem? Maybe you're adding something in the request scope in the
render phase that is not available when the page is rendered again?

Nils-H

On Tue, Mar 3, 2009 at 5:05 PM,  <hermann.x.lau@jpmchase.com> wrote:
> I took a look at the jsp that is the result of the submit and I am not
> seeing any issues with it.  Maybe someone here can find something that I
> am not seeing?
>
> noResults.jsp:
> <%@taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"%>
>
> <portlet:defineObjects />
> <center>
> <bean:write name="searchBean" property="count" /> Results Found For Your
> Search:
> <br><br>
> <table>
>        <tr>
>                <th>Location:</th>
>                <td><bean:write name="searchBean" property="location" 
/></
> td>
>        </tr>
>        <tr>
>                <th>Client Id:</th>
>                <td><bean:write name="searchBean" property="clientId" 
/></
> td>
>        </tr>
>        <tr>
>                <th>Stock Id:</th>
>                <td><bean:write name="searchBean" property="stockId" /></
> td>
>        </tr>
> </table>
> </center>
> <br>
> <div align="center"><html:link page="welcome.jsp">Search 
Again</html:link>
> </div>
>
>
>
>
>
> Nils-Helge Garli Hegvik <nilsga@gmail.com>
> 03/02/2009 11:59 AM
> Please respond to
> "Struts Users Mailing List" <user@struts.apache.org>
>
>
> To
> Struts Users Mailing List <user@struts.apache.org>
> cc
>
> Subject
> Re: javax.servlet.jsp.JspException: Cannot find bean under name
>
>
>
>
>
>
> Um.... So the location option list (and rest of the page) is rendered
> just fine? Then I guess it's the jsp that is the result of the submit
> that causes the error?
>
> Nils-H
>
> On Mon, Mar 2, 2009 at 4:22 PM,  <hermann.x.lau@jpmchase.com> wrote:
>> Yes, adding <bean:write name="locationList"/> to my code does render 
the
>> locationList.  I don't get the exception until the 'submit' button is
>> clicked.
>>
>>
>>
>>
>> Nils-Helge Garli Hegvik <nilsga@gmail.com>
>> 02/27/2009 01:27 PM
>> Please respond to
>> "Struts Users Mailing List" <user@struts.apache.org>
>>
>>
>> To
>> Struts Users Mailing List <user@struts.apache.org>
>> cc
>>
>> Subject
>> Re: javax.servlet.jsp.JspException: Cannot find bean under name
>>
>>
>>
>>
>>
>>
>> Does <bean:write name="locationList"/> render anything?
>>
>> Nils-H
>>
>> On Fri, Feb 27, 2009 at 4:17 PM,  <hermann.x.lau@jpmchase.com> wrote:
>>> Yes,
>>>
>>> I have a class where locationList is put in a RenderRequest object...
>>>
>>>
>>> ...
>>> log.info("Get Connection ");
>>> conn = ADFDAOUtil.getConnection(getDataSource(request));
>>> dao = new CPCInventoryDAO(conn);
>>> ArrayList locList = dao.getLocations(mode);
>>> request.setAttribute("locationList", locList);
>>> ...
>>>
>>>
>>>
>>>
>>> Nils-Helge Garli Hegvik <nilsga@gmail.com>
>>> 02/26/2009 04:11 PM
>>> Please respond to
>>> "Struts Users Mailing List" <user@struts.apache.org>
>>>
>>>
>>> To
>>> Struts Users Mailing List <user@struts.apache.org>
>>> cc
>>>
>>> Subject
>>> Re: javax.servlet.jsp.JspException: Cannot find bean under name
>>>
>>>
>>>
>>>
>>>
>>>
>>> Have you put a collection named "locationList" in some scope?
>>>
>>> Nils-H
>>>
>>> On Thu, Feb 26, 2009 at 10:01 PM,  <hermann.x.lau@jpmchase.com> wrote:
>>>> Hi,
>>>>
>>>> I am receiving this exception on my portlet.... what am I missing?
>>>> ServletWrappe E   SRVE0068E: Uncaught exception thrown in one of the
>>>> service methods of the servlet: SPSInventory Portlet
>>>> . Exception thrown : javax.servlet.ServletException:
>>>> javax.portlet.PortletException: javax.servlet.jsp.JspException: 
Cannot
>>>> find bean under name locationList
>>>>        at
>>>>
>>>
>>
> 
com.ibm.ws.portletcontainer.invoker.impl.PortletServlet.doDispatch(PortletServlet.java:361)
>>>>        at
>>>>
>>>
>>
> 
com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:82)
>>>>        ....
>>>>
>>>> Here is the main body in index.jsp:
>>>> <div align="center"><html:form focus="stock_id"
>>>>        action="/searchInventory">
>>>>        <TABLE border="0">
>>>>                <TBODY>
>>>>                        <TR>
>>>>                                <TH>Location</TH>
>>>>                                <TD><html:select property="location"
>>> size=
>>>> "1"
>>>>                                        styleId="location">
>>>>                                        <html:options collection=
>>>> "locationList" property="name" />
>>>>                                </html:select></TD>
>>>>                        </TR>
>>>>                        <TR>
>>>>                                <TH>Client Id</TH>
>>>>                                <TD><html:select property="client_id"
>>> size
>>>> ="1">
>>>>                                        <html:options collection=
>>>> "clientList" property="name" />
>>>>                                </html:select></TD>
>>>>                        </TR>
>>>>                        <TR>
>>>>                                <TH>Stock Id</TH>
>>>>                                <TD><html:text property="stock_id"
>>> styleId
>>>> ="field1"
>>>>                                        onfocus="field1.select()"
>> onblur=
>>>> "setFocus()" /></TD>
>>>>                        </TR>
>>>>                        <TR>
>>>>                                <TD><html:submit property="submit"
>> value=
>>>> "Submit" /></TD>
>>>>                                <TD><html:reset /></TD>
>>>>                        </TR>
>>>>                </TBODY>
>>>>        </TABLE>
>>>>        <BR></BR>
>>>> </html:form></div>
>>>>
>>>>
>>>> Here is part of my struts-config file:
>>>>        <!-- Form Beans -->
>>>>        <form-beans>
>>>>                <form-bean name="requestFormBean" type=
>>>> "com.chase.adf.cpcinventory.forms.RequestFormBean">
>>>>                </form-bean>
>>>>        </form-beans>
>>>>
>>>>      <!-- Global Forwards -->
>>>>        <global-forwards>
>>>>                <forward name="getSearch" path="/getSearch.do" />
>>>>                <forward name="backToList" path="/summaryResults.jsp"
> />
>>>>        </global-forwards>
>>>>
>>>>        <!-- Action Mappings -->
>>>>        <action-mappings>
>>>>                <action name="requestFormBean" path="/searchInventory"
>>>> scope="session" type=
>>>> "com.chase.adf.cpcinventory.actions.SearchInventoryAction">
>>>>                        <forward name="success" path="/result.jsp">
>>>>                        </forward>
>>>>                        <forward contextRelative="false" 
name="failure"
>>>> path="/failure.jsp">
>>>>                        </forward>
>>>>                        <forward contextRelative="false" name=
>>>> "noResultsFound" path="/noResults.jsp">
>>>>                        </forward>
>>>>                        <forward contextRelative="false" name=
>>>> "multipleResultsFound" path="/summaryResults.jsp">
>>>>                        </forward>
>>>>                </action>
>>>>                <action name="requestFormBean" path="/getSearch" 
scope=
>>>> "session" type="com.chase.adf.cpcinventory.actions.GetSearchAction">
>>>>                        <forward name="failure" path="/failure.jsp">
>>>>                        </forward>
>>>>                        <forward name="success" path="/index.jsp">
>>>>                        </forward>
>>>>                </action>
>>>>        </action-mappings>
>>>>
>>>> -----------------------------------------
>>>> This communication is for informational purposes only. It is not
>>>> intended as an offer or solicitation for the purchase or sale of
>>>> any financial instrument or as an official confirmation of any
>>>> transaction. All market prices, data and other information are not
>>>> warranted as to completeness or accuracy and are subject to change
>>>> without notice. Any comments or statements made herein do not
>>>> necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
>>>> and affiliates.
>>>>
>>>> This transmission may contain information that is privileged,
>>>> confidential, legally privileged, and/or exempt from disclosure
>>>> under applicable law. If you are not the intended recipient, you
>>>> are hereby notified that any disclosure, copying, distribution, or
>>>> use of the information contained herein (including any reliance
>>>> thereon) is STRICTLY PROHIBITED. Although this transmission and any
>>>> attachments are believed to be free of any virus or other defect
>>>> that might affect any computer system into which it is received and
>>>> opened, it is the responsibility of the recipient to ensure that it
>>>> is virus free and no responsibility is accepted by JPMorgan Chase &
>>>> Co., its subsidiaries and affiliates, as applicable, for any loss
>>>> or damage arising in any way from its use. If you received this
>>>> transmission in error, please immediately contact the sender and
>>>> destroy the material in its entirety, whether in electronic or hard
>>>> copy format. Thank you.
>>>>
>>>> Please refer to http://www.jpmorgan.com/pages/disclosures for
>>>> disclosures relating to UK legal entities.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>>
>>> -----------------------------------------
>>> This communication is for informational purposes only. It is not
>>> intended as an offer or solicitation for the purchase or sale of
>>> any financial instrument or as an official confirmation of any
>>> transaction. All market prices, data and other information are not
>>> warranted as to completeness or accuracy and are subject to change
>>> without notice. Any comments or statements made herein do not
>>> necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
>>> and affiliates.
>>>
>>> This transmission may contain information that is privileged,
>>> confidential, legally privileged, and/or exempt from disclosure
>>> under applicable law. If you are not the intended recipient, you
>>> are hereby notified that any disclosure, copying, distribution, or
>>> use of the information contained herein (including any reliance
>>> thereon) is STRICTLY PROHIBITED. Although this transmission and any
>>> attachments are believed to be free of any virus or other defect
>>> that might affect any computer system into which it is received and
>>> opened, it is the responsibility of the recipient to ensure that it
>>> is virus free and no responsibility is accepted by JPMorgan Chase &
>>> Co., its subsidiaries and affiliates, as applicable, for any loss
>>> or damage arising in any way from its use. If you received this
>>> transmission in error, please immediately contact the sender and
>>> destroy the material in its entirety, whether in electronic or hard
>>> copy format. Thank you.
>>>
>>> Please refer to http://www.jpmorgan.com/pages/disclosures for
>>> disclosures relating to UK legal entities.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>>
>> -----------------------------------------
>> This communication is for informational purposes only. It is not
>> intended as an offer or solicitation for the purchase or sale of
>> any financial instrument or as an official confirmation of any
>> transaction. All market prices, data and other information are not
>> warranted as to completeness or accuracy and are subject to change
>> without notice. Any comments or statements made herein do not
>> necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
>> and affiliates.
>>
>> This transmission may contain information that is privileged,
>> confidential, legally privileged, and/or exempt from disclosure
>> under applicable law. If you are not the intended recipient, you
>> are hereby notified that any disclosure, copying, distribution, or
>> use of the information contained herein (including any reliance
>> thereon) is STRICTLY PROHIBITED. Although this transmission and any
>> attachments are believed to be free of any virus or other defect
>> that might affect any computer system into which it is received and
>> opened, it is the responsibility of the recipient to ensure that it
>> is virus free and no responsibility is accepted by JPMorgan Chase &
>> Co., its subsidiaries and affiliates, as applicable, for any loss
>> or damage arising in any way from its use. If you received this
>> transmission in error, please immediately contact the sender and
>> destroy the material in its entirety, whether in electronic or hard
>> copy format. Thank you.
>>
>> Please refer to http://www.jpmorgan.com/pages/disclosures for
>> disclosures relating to UK legal entities.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
> -----------------------------------------
> This communication is for informational purposes only. It is not
> intended as an offer or solicitation for the purchase or sale of
> any financial instrument or as an official confirmation of any
> transaction. All market prices, data and other information are not
> warranted as to completeness or accuracy and are subject to change
> without notice. Any comments or statements made herein do not
> necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
> and affiliates.
>
> This transmission may contain information that is privileged,
> confidential, legally privileged, and/or exempt from disclosure
> under applicable law. If you are not the intended recipient, you
> are hereby notified that any disclosure, copying, distribution, or
> use of the information contained herein (including any reliance
> thereon) is STRICTLY PROHIBITED. Although this transmission and any
> attachments are believed to be free of any virus or other defect
> that might affect any computer system into which it is received and
> opened, it is the responsibility of the recipient to ensure that it
> is virus free and no responsibility is accepted by JPMorgan Chase &
> Co., its subsidiaries and affiliates, as applicable, for any loss
> or damage arising in any way from its use. If you received this
> transmission in error, please immediately contact the sender and
> destroy the material in its entirety, whether in electronic or hard
> copy format. Thank you.
>
> Please refer to http://www.jpmorgan.com/pages/disclosures for
> disclosures relating to UK legal entities.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org





-----------------------------------------
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message