• 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

Exception creating bean of class sample.LookSymbol

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,

I am new to Struts. I have created an application.
But it is throwing the exception as:
org.apache.jasper.JasperException: Exception creating bean of class sample.LookSymbolForm: java.lang.ClassNotFoundException: sample.LookSymbolForm

I have checked everything, but not able to locate the error. can any body help me out.

Jsp Page:
<html:html>
<html:form action="lookSymbol.do"
name="LookSymbolForm" type="sample.LookSymbolForm">
<table width="100%">
<tr>
<td>Vinayak's first Struts Project.</td>
</tr>
</table>
<table width="100%">
<tr>
<td>Symbol:<html:text property="symbol" /></td>
</tr>
<tr>
<td><html:submit value="Submit Symbol" /></td>
</tr>
</table>
</html:form>
</html:html>

LookSymbolForm.java::
package sample;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
* Type the Comments.
*
*/
public class LookSymbolForm extends ActionForm {

/**
* Declarations of Variables.
*/
private String symbol;

/**
* @return Returns the symbol.
*/
public String getSymbol() {
return symbol;
}
/**
* @param symbol The symbol to set.
*/
public void setSymbol(String symbol) {
this.symbol = symbol;
}

public void reset(ActionMapping mapping, HttpServletRequest req) {
this.symbol = null;
}
}
struts-config.xml::
<form-beans>
<form-bean name="LookSymbolForm" type="sample.LookSymbolForm"/>
</form-beans>
<action-mappings>
<action input="/pages/start.jsp" name="LookSymbolForm" scope="session" path="/lookSymbol" type="sample.LookSymbolAction">
<forward name="SUCCESS" path="/pages/view.jsp"/>
<forward name="FAILURE" path="/pages/start.jsp"/>
</action>
</action-mappings>

So, please help me.
 
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When did you get this exception? Some advices (not sure if they help): (1) in <html:form> name & type attribute are deprecated; (2) in <action> usually if I specify input= I would add validate="true"
 
Vinayak kk
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello Alec,

I am getting this exception when i m submitting the jsp page.
I will check with the things what you have suggested.
Thanks in advance
Vinayak
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic