Anurag Pathak

Greenhorn
+ Follow
since Jun 08, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anurag Pathak

Hi,

I am using InitialContext Java API and have a pool of 50 Connections.
Now a scenario is there wherein all 50 connections are used and I have 20 new Connection Request assuming maxIdle and MaxWait are set to zero.
In this scenario what will happen whether these 20 users will have to wait or I have to create a new pool.
Please let me know the standard way around what is followed in Standard Java Coding.
Awaiting Response.

Regards

Anurag
Hi,

Thanks for the reply but how I am going to pass the uploaded file name to antivirus exe.

The Antivirus Installed can be any Anti Virus .

Please Ellaborate with some sample code which will help me .

Thanks & Regards

Anurag
8 years ago
Hi,

I want to code a private chat application just like gmail.

How this is possible with JSP .

Please help with some sample codes.

Regards

Anurag
8 years ago
JSP
Hi,

I uploading a file through java before that i need to undergo antivirus scan just like yahoo site.

Please guide me with some sample code how this can be achived.

Regards

Anurag
8 years ago
Thanks David but the suggested page is not opening full niether its giving any idea of how to rename the struts.xml file.

If you can suggest some better example it will be great.

Regards

Anurag
8 years ago
Hi All

I am trying to rename struts.xml file in struts2.0, but it is giving me error.

Please let me know if we can do this.

Thanks In advance
8 years ago
Hi,

This is Anurag Pathak.

I tried a lot but could not get the Java/JSP/Servlet Source Code to import Contact Details from various Websites.

If any body has done it in past or any link please help.

On Net PHP etc are available but I want the same in Java.

Looking forward for urgent reply.

Regards

Anurag
9 years ago
Hi,

This is Anurag Pathak.

I have one doubt regarding OOPS Concept.

Can Any body explain Encapsulation in Java how it is achived through small practical example.

Looking forward for reply.

Thanks & Regards

Anurag Pathak

pathak_arg@yahoo.com

9 years ago

Ulf Dittmer wrote:Please post the code -using CODE tags- and the HTML tag that you're now using, and the full stack trace of the exception.

9 years ago

Ulf Dittmer wrote:It looks as if the error message above is incomplete; is there more to it in the Java Console?

Have you fixed the issue with the missing archive attribute by now?

CERMeter demo = new CERMeter();


Never, ever, use a constructor in an applet. The browser JVM calls the no-argument constructor when it starts the applet - your code has no business doing that.



I have put in another method and added archive also still its not working .

I am not able to figure it out specific problem.

Please guide me with some sample code
9 years ago

Ulf Dittmer wrote:Please edit your post to UseCodeTags. It's unnecessarily hard to read the code as it is, making it less likely that people will bother to do so.

The ChartDirector.jar file must be referenced in the applet tag through an "archive" attribute. That's probably not the cause of the exception, though.

What is this:

public CERMeter()
{
}



Thanks for Suggestion I will follow it in future.
But how to run the code please guide me where I am going wrong I will be very greatfull
9 years ago
//Following is the error log I receive

java.lang.NullPointerException
at sun.plugin2.applet.Plugin2Manager.findAppletJDKLevel(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.NullPointerException

//
Below is the Java Code

import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.ImageObserver;

import javax.swing.*;
import ChartDirector.*;
public class CERMeter extends Applet{

String finalImage=null;
Graphics graphics=null;
Image image;
Image image1;
ImageObserver obs ;
public void init()
{


}



//Name of demo program
public String toString() {
return "CER Meter";

}

//Number of charts produced in this demo
public int getNoOfCharts() {
return 1;

}
//Main code for creating charts
public Image createChart(ChartViewer viewer, int index)
{
// The value to display on the meter
double value = 60;

// Create an AugularMeter object of size 200 x 200 pixels, with silver
// background, black border, 2 pixel 3D depressed border and rounded corners.
AngularMeter m = new AngularMeter(200, 200, Chart.silverColor(), 0x000000, -2
);
m.setRoundedFrame();

// Set the meter center at (100, 100), with radius 85 pixels, and span from
// -135 to +135 degress
m.setMeter(100, 100, 85, -135, 135);

// Meter scale is 0 - 100, with major tick every 10 units, minor tick every 5
// units, and micro tick every 1 units
m.setScale(0, 100, 10, 5, 1);

// Disable default angular arc by setting its width to 0. Set 2 pixels line
// width for major tick, and 1 pixel line width for minor ticks.
m.setLineWidth(0, 2, 1);

// Set the circular meter surface as metallic blue (9999DD)
m.addRing(0, 90, Chart.metalColor(0x9999dd));

// Add a blue (6666FF) ring between radii 88 - 90 as decoration
m.addRing(88, 90, 0x6666ff);

// Set 0 - 60 as green (99FF99) zone, 60 - 80 as yellow (FFFF00) zone, and 80
// - 100 as red (FF3333) zone
m.addZone(0, 60, 0x99ff99);
m.addZone(60, 80, 0xffff00);
m.addZone(80, 100, 0xff3333);

// Add a text label centered at (100, 135) with 15 pts Arial Bold font
m.addText(100, 135, "CER", "Arial Bold", 15, Chart.TextColor, Chart.Center);

// Add a text box centered at (100, 165) showing the value formatted to 2
// decimal places, using white text on a black background, and with 1 pixel
// 3D depressed border
m.addText(100, 165, m.formatValue(value, "2"), "Arial", 8, 0xffffff,
Chart.Center).setBackground(0x000000, 0x000000, -1);

// Add a semi-transparent blue (40333399) pointer at the specified value
m.addPointer(value, 0x40333399);

// Output the chart
viewer.setImage(m.makeImage());
image=m.makeImage();
return image;
}

public void paint(Graphics g){
CERMeter demo = new CERMeter();
ChartViewer viewer = new ChartViewer();
image1=demo.createChart(viewer, 0);


//graphics = image.getGraphics();

g.drawImage(image1,100,100,this);


}

public CERMeter()
{

}


}
//Below is the JSP Code which I call to Load Applets

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="ChartDirector.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<table width="90%" border="0" align ="center" cellpadding="5" cellspacing="0">
<tr>
<td align="center" >
<APPLET CODE="CERMeter.class" HEIGHT=200 WIDTH=310>



</APPLET>
</td>


</body>
</html>


//*********Code Ends****************//

In Java when I run as Applet it runs fine but when I run through JSP It gives above error.

I have Included ChartDirector.jar and both JSP and JavaClass are in same folder.

Please help me to resolve the same.

Looking forward for an earliest reply

Regards

Anurag Pathak

pathak_arg@yahoo.com



9 years ago
Hi,

This is Anurag Pathak.

I wanted to know that whether there is any way for pagination in JSP apart from display tag.

The same should also convert it to pdf etc.

Looking forward for an earliest reply.

Regards

Anurag Pathak

pathak_arg@yahoo.com
Hi All,

This is Anurag Pathak.

I wanted to know that is there any way to convert HTML Code contaning tables to PDF using Java Code.

Please give me sample code example.

Loooking forward for earliest reply.

Regards

Anurag

pathak_arg@yahoo.com
9 years ago
JSP
Hi,

This is Anurag Pathak.

I am using display tag with displaytag-1.1.1.jar I want to set a footer even though it shows in .jsp page but is not visible in pdf.

Secondly I want to include a static table how can I include the same in display tag and same should be pdf generated.

Please help me to sort this out with examples and suggestions.

Looking for earliest reply.

Regards

Anurag Pathak