siva prakashmahendran

Greenhorn
+ Follow
since May 03, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by siva prakashmahendran

Hii right now I am using Struts 1.1 framework .
Now I would plan to Use Spring Framework in my application .
Can I Use Spring framework in struts 1.1 ?
Please I need valuable Reply
Thanks In Advance....
13 years ago
why can't I define an abstract static method?


abstract class foo {
abstract void bar( ); // <-- this is ok
abstract static void bar2(); //<-- this isn't why?
}

13 years ago
Can any one please explain me
the difference between abstract class and interface in java

which one is best for designing the web application wheather abstract class or interface ?


thanks in advance
14 years ago
Thank you very much for all replied me this one is very usefull to me ...
14 years ago
surfing all related java sites and forum I cant able to get the answer for
when we going for abstract class ?
Please help me out ....



thanks in advance
14 years ago
how to retaining the value of combo box after page got refreshed
14 years ago
JSP
String re = "0.00";
BigDecimal totalrev = new BigDecimal(re);

String rev1 = (String)empSalesRevenueOm.get(loginid);
BigDecimal amount1 = new BigDecimal(rev1);
I got 138731.72 kind of value in rev1 variable

so when i add rev and totalrev

totalrev = amount1.add(totalrev);


i Got the following exception

Exception in java.math.BigDecimal.<init>(BigDecimal.java:647) :java.lang.NullPointerException


Need Help Thanks in Advance


14 years ago
I need to calculate percentage relative to a particular bar within the series in bar chart
Could any one help me out
14 years ago
static class LabelGenerator implements CategoryLabelGenerator
{
public float var;
public LabelGenerator(float var){
this.var = var;
//ETHLogger.log( "var ---->" + var);
}
public String generateLabel(CategoryDataset dataset,int series,int category )
{
String result = null;
final Number value = dataset.getValue(series, category);
return ""+value;
}


}
private JFreeChart createBarChart(HttpServletRequest request,String hval) {
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
ReportsBean bean = new ReportsBean();
ConnectionFactory conFac = new ConnectionFactory();
Connection con=conFac.getConnection();
Vector vec1=new Vector();
HttpSession session = request.getSession(false);

vec1 = (Vector)session.getAttribute("vec");
String Fdate="";
JFreeChart chart=null;
float var[];

try {
var = new float[vec1.size()];
for(int i=0;i<vec1.size();i++)
{
String VarianceDetail = (String)vec1.get(i);
StringTokenizer st=new StringTokenizer(VarianceDetail,"$");
String prdname=st.nextToken();
String id = st.nextToken();
String uom=st.nextToken();
float plan=Float.parseFloat(st.nextToken());
int plan1 = (int) plan ;
float actual=Float.parseFloat(st.nextToken());
int actual1 = (int) actual ;

if(hval.equals(id)){
String series1 = "Planned ";
String series2 = "Actual";

String category1 = "Planned";
String category2 = "Actual";
String category = "";

dataset.addValue(plan, series1, category);
dataset.addValue(actual, series2, category);

}
if(request.getParameter("fromdate")!=null){
String fromdate = request.getParameter("fromdate");

}
if(request.getParameter("todate")!=null){
String todate = request.getParameter("todate");

}

if(dataset!=null){
if(hval.equals(id)){

chart = ChartFactory.createBarChart3D(
prdname,
"Comparision",
"Quantity in "+ uom ,
dataset,
PlotOrientation.VERTICAL,
true,
true,
false
);

}}}


CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);


NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();

rangeAxis.setUpperMargin(0.5);





CategoryItemRenderer renderer = plot.getRenderer();
renderer.setItemLabelPaint(Color.white.brighter());



for(int i =0;i<var.length;i++){

renderer.setLabelGenerator(new LabelGenerator(var[i]));

renderer.setItemLabelFont(new Font("Serif", Font.PLAIN, 20));
renderer.setItemLabelsVisible(null);
renderer.setSeriesItemLabelsVisible(0, false);
renderer.setSeriesItemLabelsVisible(1, true);
}



}catch(Exception e){
System.out.println("Error "+e);
}finally {
try {

if (con != null)
conFac.freeConnection(con);
} catch (Exception e1) {
System.out.println(e1);
}

}

return chart;

}
}


i can't able to display series2 dataset value in chart
Any one explain me how to solve this problem

Need Help Thanks in advance




Yes david I done by sending form elements to servlet
Instead of going to sessionobject
request object is thread safe right thats why i choose one
Any way thanks for valuable help man
14 years ago
JSP
Can you please give me the solution for this problem
14 years ago
JSP
I need to set request attribute in jsp and getting that attribute in servlet
Here is my code sippets
In jsp
<% Vector vt1 = new Vector();
request.setAttribute("vt1" ,vt1);
%>
In servlet
Vector vt = new Vector();
vt = (Vector) request.getAttribute("vt1" );
I got the following Exception
java.lang.NullPointerException


14 years ago
JSP