You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "CUCKSON, Nick, FM" <Ni...@rbos.com> on 2003/10/14 11:50:37 UTC

RE: Probelm with the tag.

Anunay,

you need to add accessor methods to your bean for the property bookId.
ie 
public void setBookId(String bookId) { this.bookId = bookId; }
public String getBookId() { return bookId; }

and set the property from the jsp page.
eg
<jsp:setProperty name="rangePage" property="*" />

Nick

-----Original Message-----
From: anunay ashish [mailto:anunaya@tis.co.in]
Sent: 14 October 2003 10:13
To: Tomcat Users List
Subject: Probelm with the <jsp:setProperty /> tag. 


Hi,
I am facing difficulty while using setProperty tag in JSP.
My JSP page is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> Page ranges </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
  <%@ page import="java.sql.*" %>
  <%! String bookId; %>

  <jsp:useBean id="rangePage" scope="session"
class="com.scheduler.rangeUpdate" />
  <!--jsp:setProperty name="rangePage" property="bookId" param="bookId" /-->
  <%
   bookId = request.getParameter("bookId");
   out.print(bookId);
   rangePage.callProcess();
  %>
 </BODY>
</HTML>

and my bean is:
package com.scheduler;

import java.sql.*;

public class rangeUpdate
{
 private String bookId;

 public void callProcess()
 {
  System.out.println("BookId: " + bookId);
 }
}

I got an error as follows:
org.apache.jasper.JasperException: Cannot find any information on property
'bookId' in a bean of type 'com.scheduler.rangeUpdate'

Where I am going wrong?

Thanks in advance.

Regards,
Anunay Ashish.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


***********************************************************************************
This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland plc is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
             Regulated by the Financial Services Authority

            Visit our website at http://www.rbs.co.uk/CBFM/
***********************************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Probelm with the tag.

Posted by anunay ashish <an...@tis.co.in>.
Nick,
Can I also use the variable name in property attribute instead of "*"?
Regards,
Anunay.
----- Original Message -----
From: "CUCKSON, Nick, FM" <Ni...@rbos.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Tuesday, October 14, 2003 3:20 PM
Subject: RE: Probelm with the <jsp:setProperty /> tag.


> Anunay,
>
> you need to add accessor methods to your bean for the property bookId.
> ie
> public void setBookId(String bookId) { this.bookId = bookId; }
> public String getBookId() { return bookId; }
>
> and set the property from the jsp page.
> eg
> <jsp:setProperty name="rangePage" property="*" />
>
> Nick
>
> -----Original Message-----
> From: anunay ashish [mailto:anunaya@tis.co.in]
> Sent: 14 October 2003 10:13
> To: Tomcat Users List
> Subject: Probelm with the <jsp:setProperty /> tag.
>
>
> Hi,
> I am facing difficulty while using setProperty tag in JSP.
> My JSP page is:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
>  <HEAD>
>   <TITLE> Page ranges </TITLE>
>   <META NAME="Generator" CONTENT="EditPlus">
>   <META NAME="Author" CONTENT="">
>   <META NAME="Keywords" CONTENT="">
>   <META NAME="Description" CONTENT="">
>  </HEAD>
>
>  <BODY>
>   <%@ page import="java.sql.*" %>
>   <%! String bookId; %>
>
>   <jsp:useBean id="rangePage" scope="session"
> class="com.scheduler.rangeUpdate" />
>   <!--jsp:setProperty name="rangePage" property="bookId" param="bookId"
/-->
>   <%
>    bookId = request.getParameter("bookId");
>    out.print(bookId);
>    rangePage.callProcess();
>   %>
>  </BODY>
> </HTML>
>
> and my bean is:
> package com.scheduler;
>
> import java.sql.*;
>
> public class rangeUpdate
> {
>  private String bookId;
>
>  public void callProcess()
>  {
>   System.out.println("BookId: " + bookId);
>  }
> }
>
> I got an error as follows:
> org.apache.jasper.JasperException: Cannot find any information on property
> 'bookId' in a bean of type 'com.scheduler.rangeUpdate'
>
> Where I am going wrong?
>
> Thanks in advance.
>
> Regards,
> Anunay Ashish.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
****************************************************************************
*******
> This e-mail is intended only for the addressee named above.
> As this e-mail may contain confidential or privileged information,
> if you are not the named addressee, you are not authorised to
> retain, read, copy or disseminate this message or any part of it.
> The Royal Bank of Scotland plc is registered in Scotland No 90312
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
>              Regulated by the Financial Services Authority
>
>             Visit our website at http://www.rbs.co.uk/CBFM/
>
****************************************************************************
*******
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org