This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Getting Exception creating bean of class JSP Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Getting Exception creating bean of class JSP Exception" Watch "Getting Exception creating bean of class JSP Exception" New topic

Getting Exception creating bean of class JSP Exception

Priyanka Mathur

Joined: Aug 01, 2008
Posts: 2
I am getting the below JSP Exception

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Exception creating bean of class com.sample.form.UserLoginForm: {1}

The is as below

package com.sample.form;

import javax.servlet.http.HttpServletRequest;

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

public class UserLoginForm extends ActionForm{
private String userid = null;
private String password = null;
public void reset(ActionMapping mapping,HttpServletRequest request){

public ActionErrors validate(

ActionMapping mapping, HttpServletRequest request ) {
ActionErrors errors = new ActionErrors();
return errors;

public String getPassword() {
return password;

public void setPassword(String password) {
this.password = password;
public String getUserid() {
return userid;
public void setUserid(String userid) {
this.userid = userid;
The login.jsp is as below

<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<html:html locale="true">
<title>Login Page</title>
<table >
<td> <html:form action="/login" method="post">
<table border="1" class="signup">
<td >User Login
<tr >
<td >User ID:</td>
<td ><html:text property="userid" size="30" maxlength="30"/></td>
<tr >
<td >Password:</td>
<td><html:password property="password" size="30" maxlength="30"/></td>
<td ><html:submit>Sign-In !</html:submit></td>

And the struts-config.xml is as below

<form-bean name="UserLoginForm"
<forward name="success" path="/pages/task.jsp"/>
<forward name="failure" path="/pages/login.jsp"/>

Please help me out why this exception is coming.
Ankit Garg

Joined: Aug 03, 2008
Posts: 9400

Priyanka please UseCodeTags when you post source code.

Also this might help you...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Poobhathy Kannan
Ranch Hand

Joined: May 26, 2004
Posts: 94
Hi Priyanka

Shouldn't your form-bean be defined inside <form-beans></form-beans> tag?
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Getting Exception creating bean of class JSP Exception
It's not a secret anymore!