• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with <jsp:usebean tag>

 
vina kum
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • 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.
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here it gives the full explanation with some examples you can study.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
sorry for that in the place of barchart client is correct one.
Thanks
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks for your response i have replaced param value it's still giving error
Error:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic