• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with <jsp:usebean tag>

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Ranchers i am developing a page in jsp i have one java bean to be used in jsp tag dynamically suggest me with to write
<jsp:usebean tag> with set property and get property for this javabean:
public class Client implements DatasetProducer, Serializable {
private int advid;

public Barchart(int advid) {
super();
this.advid = advid;
}
public int getAdvid() {
return advid;
}
public void setAdvid(int advid) {
this.advid = advid;
}
}
please suggest me how to get this advid dynamically.
Thanks in advance.
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here it gives the full explanation with some examples you can study.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use code tag to post your code. Coming to your question,



Here Barchart is a Constructor of Client ?
 
vina kum
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response based on your url i have developed jsp use bean
jsp:useBean id="clientview" scope="session" class="com.cewolf.Barchart"/>
<jsp:setProperty name="clientview" property="advid" param="<%=request.getParameter("advid")"%> value="<%= session.getAttribute("advid")"%>/>
<jsp:getProperty name="clientview" property="advid"/>
but it's giving error please suggest me to solve this
org.apache.jasper.JasperException: /HitInfo.jsp(20,0) According to TLD, tag jsp:setProperty must be empty, but is not
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39
Thanks in advance
 
vina kum
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry for that in the place of barchart client is correct one.
Thanks
 
Vijitha Kumara
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

vina kum wrote:Thanks for your response based on your url i have developed jsp use bean
jsp:useBean id="clientview" scope="session" class="com.cewolf.Barchart"/>
<jsp:setProperty name="clientview" property="advid" param="<%=request.getParameter("advid")"%> value="<%= session.getAttribute("advid")"%>/>
<jsp:getProperty name="clientview" property="advid"/>
but it's giving error please suggest me to solve this
org.apache.jasper.JasperException: /HitInfo.jsp(20,0) According to TLD, tag jsp:setProperty must be empty, but is not
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39



As the value for the param attribute, name of the request parameter should be used, check here
 
vina kum
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response i have replaced param value it's still giving error
Error:
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic