File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Problem with <jsp:usebean tag> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with <jsp:usebean tag>" Watch "Problem with <jsp:usebean tag>" New topic
Author

Problem with <jsp:usebean tag>

vina kum
Greenhorn

Joined: Jun 24, 2009
Posts: 21
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

Joined: Mar 24, 2008
Posts: 3859

Here it gives the full explanation with some examples you can study.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Please use code tag to post your code. Coming to your question,



Here Barchart is a Constructor of Client ?
vina kum
Greenhorn

Joined: Jun 24, 2009
Posts: 21
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

Joined: Jun 24, 2009
Posts: 21
sorry for that in the place of barchart client is correct one.
Thanks
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3859

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

Joined: Jun 24, 2009
Posts: 21
Thanks for your response i have replaced param value it's still giving error
Error:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with <jsp:usebean tag>