• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple jsp:useBean error  RSS feed

 
Sandeep Sirsekar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NOTE:please DO assume symbol less-than and greater-than where necessary.in web.xml and jsp file

i've one Person.class(bean class with public const.,get/set method for property with FIRST Letter Capital)

/***************Bean Class under WEB-INF/classes directory************/
public class Person{

private String name;

public Person(){}

public void setName(String name){
this.name=name;
}

public String getName(){
return name;
}
}
/***************Bean Class***************/

/**************JSP file under my webapps ROOT*****************/
html
body

jsp:useBean id="person" class="Person" scope="request"
jsp:setProperty name="person" property="name" value="TestExample"/
/jsp:useBean

value is jsp:getProperty name="person" property="name"/

/body
/html
/**************JSP file under my webapps ROOT*****************/
and web.xml file as
/***************web.xml*************/
web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"
/web-app
/***************web.xml*************/

and copied
1)jstl.jar
2)standard.jar
these two jars inside my Tomcat6.0/lib directory

But it gives ERROR like

org.apache.jasper.JasperException: /Show.jsp(4,0) The value for the useBean class attribute Person is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)

Can anyone please tell me where im doing mistake.
[ April 18, 2008: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66157
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extermely hard to read and many people that might be able to help you will just move along. Please read this for more information.

You can go back and change your post to add code tags by clicking the .
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66157
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Classes must be in a package other than the default.
 
Sandeep Sirsekar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much.
thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!