Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By Tolls

Thread: getting error when using jsp with scrripless

  1. #1
    anchitanc is offline Member
    Join Date
    Oct 2010
    Posts
    44
    Rep Power
    0

    Default getting error when using jsp with scrripless

    hi all,

    i have servlet class name test.java
    Java Code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import foo.*;
    
    
    public class test extends HttpServlet{ 
      public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException{
    
        Employee e= new Employee();
        e.setName("nameee");
        request.setAttribute("person", e);
        
        
        
        RequestDispatcher view = request.getRequestDispatcher("jspbeantest.jsp");
        view.forward(request,response);
    
      }
    }
    and i have plain old java class name Employee.java

    Java Code:
    package foo;
    public class Employee  {
    public String name;
    public void setName(String name) {
    this.name=name;
    }
    public String getName() {
    return name;
    }
    }
    and i have jsp file name jspbeantest.jsp

    Java Code:
    <html><body>
    
    <jsp:useBean id="person" class=”foo.Employee” scope=”page”/>
    
    Person is: <jsp:getProperty name=”person” property=”name” /> 
    
    </body></html>
    when i am running this code i am getting this error:-

    org.apache.jasper.JasperException: /jspbeantest.jsp(10,32) quote symbol expected
    org.apache.jasper.compiler.DefaultErrorHandler.jsp Error(DefaultErrorHandler.java:40)
    org.apache.jasper.compiler.ErrorDispatcher.dispatc h(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspErro r(ErrorDispatcher.java:88)
    org.apache.jasper.compiler.Parser.parseAttribute(P arser.java:198)
    org.apache.jasper.compiler.Parser.parseAttributes( Parser.java:148)
    org.apache.jasper.compiler.Parser.parseUseBean(Par ser.java:929)
    org.apache.jasper.compiler.Parser.parseStandardAct ion(Parser.java:1112)
    org.apache.jasper.compiler.Parser.parseElements(Pa rser.java:1421)
    org.apache.jasper.compiler.Parser.parse(Parser.jav a:130)
    org.apache.jasper.compiler.ParserController.doPars e(ParserController.java:255)
    org.apache.jasper.compiler.ParserController.parse( ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(C ompiler.java:185)
    org.apache.jasper.compiler.Compiler.compile(Compil er.java:354)
    org.apache.jasper.compiler.Compiler.compile(Compil er.java:334)
    org.apache.jasper.compiler.Compiler.compile(Compil er.java:321)
    org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:592)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:328)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    test.doPost(test.java:36)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)


    please help where i am going wrong.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default Re: getting error when using jsp with scrripless

    org.apache.jasper.JasperException: /jspbeantest.jsp(10,32) quote symbol expected

    I'm guessing the line is:
    Java Code:
    <jsp:useBean id="person" class=”foo.Employee” scope=”page”/>
    Character 32 is the open quote for foo.
    Look at that character (and the rest of them in your JSP code snippet after this one)...it's not the same as the quotes around person.
    Looks to me like a cut 'n' paste from some Microsoft produced document.
    anchitanc likes this.

  3. #3
    anchitanc is offline Member
    Join Date
    Oct 2010
    Posts
    44
    Rep Power
    0

    Default Re: getting error when using jsp with scrripless

    i got it

    thanks tolls

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default Re: getting error when using jsp with scrripless

    No problem.

Similar Threads

  1. java out of memory error-heap space error
    By elsanthosh in forum NetBeans
    Replies: 4
    Last Post: 06-15-2010, 09:31 AM
  2. Replies: 1
    Last Post: 03-10-2010, 01:53 PM
  3. Replies: 1
    Last Post: 12-05-2009, 07:28 AM
  4. Replies: 1
    Last Post: 10-26-2009, 04:38 PM
  5. Replies: 3
    Last Post: 01-23-2009, 08: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
  •