File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and Other Java EE Technologies and the fly likes Plz help not able to run simple JSP and Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "Plz help not able to run simple JSP and Bean" Watch "Plz help not able to run simple JSP and Bean" New topic
Author

Plz help not able to run simple JSP and Bean

Pradeep Kanwar
Ranch Hand

Joined: Jun 11, 2001
Posts: 38
Friends,
I tried a lot on tomcat but no success and left it. Now on J2EE server .. still no success.
I want to try a simple jsp with a java bean. here is the code for both
JSP/// TestJSP.jsp
<jsp:useBean id="name" class="JavaBean" />
<html>
<body>
<%= name.getName() %>
</body>
</html>
JavaBean// JavaBean.java
public class JavaBean
{
private String myName;
public JavaBean()
{
myName = "Pradeep Kanwar";
}
public String getName()
{
return myName;
}
public void setName(String name)
{
myName = name;
}
}
I've put JSP in j2sdkee1.3\public_html file and put bean in j2sdkee1.3\lib\classes
When i access it with http://localhost:8000/TestJSP.jsp, i get the following error:

org.apache.jasper.JasperException: Unable to compile class for JSPc:\j2sdkee1.3\repository\aravali\web\_0002fTestJSP_jsp.java:57: Class org.apache.jsp.JavaBean not found.
JavaBean name = null;
^
c:\j2sdkee1.3\repository\aravali\web\_0002fTestJSP_jsp.java:60: Class org.apache.jsp.JavaBean not found.
name= (JavaBean)
^
c:\j2sdkee1.3\repository\aravali\web\_0002fTestJSP_jsp.java:65: Class org.apache.jsp.JavaBean not found.
name = (JavaBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "JavaBean");
^
Friends, plz let me know where i am wrong.
Thanks a ton in advance
pradi
 
 
subject: Plz help not able to run simple JSP and Bean
 
IntelliJ Java IDE