Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt in jsp:useBean

 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class attribute, or type attribute, or beanName must specify a bean with all properties of type string??
for example supose the BeanX:
public class BeanX implements java.io.Serializable{
private Integer i;
private java.util.Date d;
public void setI(Integer i){this.i=i;}
public Integer getI(){return this.i;}
public void setD(java.util.Date d){this.d=d;}
public java.util.Date getD(){return this.d;}
}
if used in test.jsp this way:
<%!--code for test.jsp--%>
<jsp:useBean id='x' class='BeanX'/>
<jsp:setProperty name='x' property='*'/>
if you request test.jsp?i=2&d=02/02/2003
you're going to face lots of exceptions...
is this normal?
Thanks, in advance...
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the JSP Spec JSP.2.13.2.1 Conversions from String values. For a java.util.Date, you must have a PropertyEditor defined for the Bean. The int param should work fine, as should an primitive or String value.
[ February 22, 2004: Message edited by: Michael Morris ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic