Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception creating bean of class sample.LookSymbol

 
Vinayak kk
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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.
 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic