Results 1 to 5 of 5
  1. #1
    raj.mscking@gmail.com's Avatar
    raj.mscking@gmail.com is offline Senior Member
    Join Date
    Jan 2012
    Location
    TamilNadu
    Posts
    272
    Rep Power
    3

    Default JSP is making problem in netbeans

    Hi Happy To Meet You All!
    I am beginner to NetBeans for create JSP,
    Any one can help me "How to build basic JSP in Netbeans"

    i try by below example. But it making problem..,

    JDK = jdk1.6.0_25
    NetBeans = NetBeans IDE 7.0.1
    Apache =Apache Tomcat 6.0.26

    My code is

    index.jsp

    Java Code:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <h1>Entry Form</h1>
            <form name="Form Action" action="response.jsp">
                Enter Your Name :
                <input type="text" name="name" value="">
                <input type="submit" value="ok">
            </form>
        </body>
    </html>

    response.jsp

    Java Code:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <jsp:useBean id="my" scope="session" class="jesus.mybeen" />
                <jsp:setProperty name="mybeen" property="name"/>
                <h1> Welcome <jsp:getProperty name="mybeen" property="name"/> </h1>
                    
        </body>
    </html>
    mybeen.java

    Java Code:
    package jesus;
    
    public class mybeen 
    {
    private String name;
    
    public mybeen ()
    {
        name = null;
    }
        public String getName() 
        {
            return name;
        }
        public void setName(String name) 
        {
            this.name = name;
        }
    }
    i am getting the error after entering value is..,

    Java Code:
    HTTP Status 500 -
    
    type Exception report
    
    message
    
    description The server encountered an internal error () that prevented it from fulfilling this request.
    
    exception
    
    org.apache.jasper.JasperException: jsp:getProperty for bean with name 'mybeen'. Name was not previously introduced as per JSP.5.3
    	org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1086)
    	org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:1124)
    	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    	org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
    	org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
    	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    	org.apache.jasper.compiler.Generator.generate(Generator.java:3416)
    	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)
    	org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
    	org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
    	org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
    	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.
    
    Apache Tomcat/6.0.26
    Any One can Guide Me to make jsp proper steps in netbeans Please..,


    Thanking You Sir..,
    - Raj

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,820
    Rep Power
    19

    Default Re: JSP is making problem in netbeans

    First off you really need to use the naming conventions.
    Classes start with a capital, variables with a lower case.

    'mybeen' is your class, not your variable.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    raj.mscking@gmail.com's Avatar
    raj.mscking@gmail.com is offline Senior Member
    Join Date
    Jan 2012
    Location
    TamilNadu
    Posts
    272
    Rep Power
    3

    Default Re: JSP is making problem in netbeans

    Thank You for your response Sir!

    as you said i change the been class & response.jsp as fallows..,

    Java Code:
    public class Mybeen 
    {
        private String name;
    
    public Mybeen ()
    {
        name = null;
    }
        public String getName() 
        {
            return name;
        }
        public void setName(String name) 
        {
            this.name = name;
        }
    }

    Java Code:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <jsp:useBean id="mybeen" scope="session" class="jesus.Mybeen" />
                <jsp:setProperty name="mybee" property="name"/>
                <h1> Welcome <jsp:getProperty name="mybee" property="name"/> </h1>
                    
        </body>
    </html>
    But! Still i am facing the same problem.,
    what problem i did & what is the way to correct it sir..,
    Thank You..,
    - Raj

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,820
    Rep Power
    19

    Default Re: JSP is making problem in netbeans

    jsp:useBean id="mybeen"
    <jsp:setProperty name="mybee"
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    raj.mscking@gmail.com's Avatar
    raj.mscking@gmail.com is offline Senior Member
    Join Date
    Jan 2012
    Location
    TamilNadu
    Posts
    272
    Rep Power
    3

    Default Re: JSP is making problem in netbeans

    Thank you for your response sir, i correct it..,
    i can realize my mistakes..,
    - Raj

Similar Threads

  1. calculate making problem while using while() loop in ResultSet
    By raj.mscking@gmail.com in forum New To Java
    Replies: 6
    Last Post: 06-18-2012, 08:30 AM
  2. Jar file making - picture problem
    By amman in forum New To Java
    Replies: 3
    Last Post: 05-06-2011, 12:14 PM
  3. problem making a gui
    By niba10 in forum AWT / Swing
    Replies: 2
    Last Post: 04-04-2011, 08:37 AM
  4. Making a netbeans project into a executable jar file
    By counterfox in forum New To Java
    Replies: 3
    Last Post: 12-03-2010, 05:09 PM
  5. Replies: 4
    Last Post: 02-24-2010, 01:53 AM

Posting Permissions

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