Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 1st, 2003, 01:19 PM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Please help me out...

I am having j2sdk...& newbeans as my IDE. If i run simple jsp it's working fine... But ,now i just created a simple class file as

public class SimpleBean {
  private String message = "No message specified";
  public SimpleBean(){}
  public String getMessage() {
    return(message);
  }
  public void setMessage(String message) {
    this.message = message;
  }
}

and my jsp is

<%@page contentType="text/html"%>
<HTML>
<BODY>
<jsp:useBean id="test" class="SimpleBean" />
<jsp:setProperty name="test" property="message" value="Hello WWW" />

<H1>Message: <I><jsp:getProperty name="test" property="message" /></I></H1>
</BODY>
</HTML>

error:

cann't resolve symbol....Class SimpleBean

I don't have any package righnow... Even though this is not working.. is that do i need to setup anything...or anymistake...

Thanks
Pratheeba


 
Old December 1st, 2003, 01:21 PM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am having j2sdk...& netbeans as my IDE. If i run simple jsp it's working fine... But ,now i just created a simple class file as

public class SimpleBean {
  private String message = "No message specified";
  public SimpleBean(){}
  public String getMessage() {
    return(message);
  }
  public void setMessage(String message) {
    this.message = message;
  }
}

and my jsp is

<%@page contentType="text/html"%>
<HTML>
<BODY>
<jsp:useBean id="test" class="SimpleBean" />
<jsp:setProperty name="test" property="message" value="Hello WWW" />

<H1>Message: <I><jsp:getProperty name="test" property="message" /></I></H1>
</BODY>
</HTML>

error:

cann't resolve symbol....Class SimpleBean

I don't have any package righnow... Even though this is not working.. is that do i need to setup anything...or anymistake...

Thanks
Pratheeba




 
Old March 5th, 2004, 05:19 AM
Registered User
 
Join Date: Mar 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Pratheeba,

I was trying out an example in the book Professional Java Server Programming J2EE Edition (Chapter 11, beans useBean example) and I experienced the same problem as you. I found the solution in the Tomcat buglist (http://nagoya.apache.org/bugzilla), bug# 10714. The problem is that the compiler looks for your SimpleBean in the jsp package and cannot find it there. The workarounnd suggested in a comment on this bug does not work, because you must also add a package name in an import directive. So you must put your SimpleBean in a package and specify it in the useBean action, e.g. class="MyPackage.SimpleBean".

Eugenio










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.