• 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

Cannot find bean TestForm in any scope'

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting the following exception on my web browser when I try to access the action

[ServletException in:/jsp/displayName.jsp] Cannot find bean TestForm in any scope'


here is my struts config

<struts-config>

<form-beans>
<form-bean name="TestForm" type="com.src.TestForm" />
</form-beans>


<action-mappings>
<action name="TestForm"
path="/myAction"
type="com.src.mytAction"
scope="session"
validate="false"
input="mytiles">
path="mytiles" />

</action>


</action-mappings>

<message-resources key="com.src.Management" null="false" parameter="myMessages" />

</struts-config>

tiles config file.

<tiles-definitions>

<!-- Deployment Requests -->
<definition extends="myDef" name="mytiles">
<put name="body" value="/jsp/displayName.jsp" />
</definition>

</tiles-definitions>

Can anybody tell me what is wrong in this configuration
[ April 15, 2006: Message edited by: Santosh Maskar ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before displaying "displayName.jsp", you must instantiate a TestForm object and place it in session scope using the statement:

request.getSession().setAttribute("Testform", new TestForm());
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

Here are few things to note while using Struts :

name of the html:form tag in jsp should have the same name as formbean and type:Testform(ur Testform.java class)

that name must be the name in action tag , name of formbean...

if these coinside and if Test form.java exists in the classpath or /web-inf/classes folder with ur structure
/com/src/../urclass.java

then it works.try with it

-eswar
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic