Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2011
    Posts
    35
    Rep Power
    0

    Default javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN i

    hii i am getting the following errors in my java jsp struts web based application.
    javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at org.apache.struts.util.RequestUtils.lookup(Request Utils.java:938)
    please help me to remove this error.
    In this i am entering task id and retrieving the data using enterAction.java from SQL server,but it is giving the error again and again.
    Thank you
    enter.jsp:
    Java Code:
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html:html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <title>untitled</title>
      </head>
      <%
        taskform form = (taskform)request.getAttribute("TaskForm");
        int taskid = form.getTaskid();
        String taskname = form.getTaskname();
      %>
      <body>
        <form>
      
          <P>Task Id 
            <html:text property="taskid"/> &nbsp;
          </P>
          <P>Task Name 
            <html:text property="taskname"/>
          </P>
          <P>Date
            <html:text property="date"/>
          </P>
          <P>
            <input type="submit" value="Update"/>
            <input type="submit" value="Delete"/>
          </P>
        </form>
      </body>
    </html:html>
    enterAction.jsp
    Java Code:
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException.*;
    import java.lang.Exception;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.*;
    import com.microsoft.sqlserver.jdbc.SQLServerConnection;
    import com.microsoft.sqlserver.jdbc.SQLServerDriver;
    
    public class enterAction extends Action 
    {
    
     public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,HttpServletResponse response) 
      {
      try
        {
        ActionForward forward;
        taskform eForm = (taskform) form; 
        int r=eForm.getTaskid();
        Connection conn = DatabaseManager.getConnection();
        Statement stmt = conn.createStatement();
        //String query = "SELECT * FROM dbo.guru WHERE task_id = "+r;
        ResultSet rs = stmt.executeQuery("select * from dbo.guru WHERE tasks_id="+r); 
        if (rs.next())
        {
          eForm.setTaskid(rs.getInt(1));
          eForm.setTaskname(rs.getString(2));
          eForm.setTaskname(rs.getString(3));
          forward=mapping.findForward("success");
           return forward;
        }
        else
        {
          forward = mapping.findForward("failure");
           return forward;
        }
    
        }
        catch(Exception ex)
        {
        ex.printStackTrace();
          return mapping.findForward("error"); 
        }
    
      }
    
    }
    taskform.java
    Java Code:
    import org.apache.struts.action.ActionForm;
    
    public class taskform extends ActionForm 
    {
    
      private int taskid;
      private String taskname;
      private String dateOfBirth;
      
      public taskform()
      {
        taskid = 0;
        taskname = "";
        dateOfBirth = "";
      }
    
    
    
      public void setTaskid(int taskid)
      {
        this.taskid = taskid;
      }
      public int getTaskid()
      {
        return taskid;
      }
    
      
      public void setTaskname(String taskname)
      {
        this.taskname = taskname;
      }
      
        public String getTaskname()
      {
        return taskname;
      }
    
      public void setDateOfBirth(String dateOfBirth)
      {
        this.dateOfBirth = dateOfBirth;
      }
    
    
      public String getDateOfBirth()
      {
        return dateOfBirth;
      }
    }
    please help me to remove the error thanking you

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

Similar Threads

  1. 500 Internal Server Error javax.servlet.jsp.JspException: Cannot find bean org.apache
    By gurpreet.singh in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 03-22-2011, 05:41 AM
  2. javax.naming.NameNotFoundException: bean not bound
    By Sirisha_24 in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 04-01-2009, 10:51 AM
  3. UREGENT-accessing session bean ok but entity bean
    By parimal in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 08-28-2008, 01:34 PM
  4. Replies: 0
    Last Post: 03-30-2008, 10:03 AM
  5. Replies: 0
    Last Post: 09-26-2007, 08:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •