facebook

Myeclipse occurs a error when I use a bean [Closed]

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #201343 Reply

    avaj
    Member

    Hi,has anyone see the following error:

    My setup:

    Windows 2000 Professional
    Eclipse 2.1.2
    MyEclipse 2.6.4
    No other external plugins
    J2SDK 1.4.1_02
    Tomcat 5.0.14 launched with J2SDK 1.4.1_02

    I creat a simple bean:

    public class Boy
    {
    private String name;
    private int age;

    public void setName(String newname)
    {
    name=newname;
    }

    public String getName()
    {
    return name;
    }

    public void setAge(int newage)
    {
    age=newage;
    }

    public int getAge()
    {
    return age;
    }
    }

    The JSP using the above bean:

    <%@page contentType=”text/html;charset=gb2312″ import=”Boy” %>
    <html>
    <head>
    <title>exmaple</title>
    </head>

    <body>
    <jsp:useBean id=”boy” class=”Boy” scope=”session”/>

    example

    <br>

    <FORM action=”” method=”post” >
    name:<INPUT type=”text” name=”name”><br>
    age:<INPUT type=”text” name=”age”><br>
    <INPUT type=”submit” name=”submit”>
    <INPUT type=”reset” name=”reset”>
    </FORM>

    <jsp:setProperty name=”boy” property=”*” />
    <p>name:
    <jsp:getProperty name=”boy” property=”name”/>
    <p>age:
    <jsp:getProperty name=”boy” property=”age”/>

    </body>
    </html>

    very simple,but myeclipse is showning errors:

    de cannot be resolved or is not a valid superclass line 1
    The method getPageContext(Servlet, ServletRequest, ServletResponse, String, boolean, int, boolean) in the type JspFactory is not applicable for the arguments (_example$002ejsp$, HttpServletRequest, HttpServletResponse, null, boolean, int, boolean) line 1
    The method getServletConfig() is undefined for the type _example$002ejsp$ example.jsp line 1
    de cannot be resolved example.jsp line 21

    who can tell me why and how to solve it?

    David

    #201345

    No Operation
    Member

    <jsp:setProperty name=”boy” property=”*” />

    -> see the “setProperty bug” thread .
    -> upgrade to current version

    NOP

    #201363

    avaj
    Member

    ha,I see,I creat a folder named com.tw and put the bean inside,and add a line on the top of the bean:package com.tw.Now it run fine.

    David

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Myeclipse occurs a error when I use a bean [Closed]

You must be logged in to post in the forum log in