| _scripting engines for java applications_ |
|
 |
Index ‹ java-programmer
|
- Previous
- 6
- GridBag Layout queriesIt might appear long, but I think the answers will be of
just a few words describing the correct command/syntax.
After the Jbutton part has run successfully, the following
difficulties are coming in the next step.
- Individual buttons are not coming as same width. Whichever
button has more text or wider letters is coming wider, and
others are coming less wider.
- though left edge of a column of button is duly aligned,
the right edge is becoming zigzag due to the above.
- width of the largest button in a column is deciding the
width of the the entire column.
how to force all button to be of same width? If all buttons
in a column are of same width, the above are automatically
solved.
I am also finding that the three characters I have to
display are appearing in the centre, and there is huge space
left at the left and right of my text in the button.
Because of this, I have to unncessary keep my window wide so
that characters remain visible, otherwise several characters
are not becoming visible.
When I put setmargin I got this compile error.
setMargin(java.awt.Insets) in javax.swing.AbstractButton
cannot be applied to (int,int,int,int)
button[gridY1][gridX1].setMargin(0,0,0,0);
The best method would have been if we could have just given
a single width for all buttons, and it would have compressed
whatever text within that width.
- Even after giving gridwidth as 2 or 3, though the button
is reserving the width of those many columns, its width is
still that of a single button. the area next to it is coming
blank.
how to make it wider to fill the columns it is covering.
- Even after giving gridheight as 2, though the button is
reserving the height of those many rows, its height is still
of a single button. the area below it is coming blank.
how to make it taller to fill the rows it is covering.
ipadx or ipadx are not working. while trying to use
gridBagL.setConstraints(button, gridBagC);
it is giving error
setConstraints(java.awt.Component,java.awt.GridBagConstraints)
in java.awt.GridBagLayout cannot be applied to
(javax.swing.JButton[][],java.awt.GridBagConstraints)
what is the default height and width of a button?
in place of using an icon in setrolloverenabled(), can we
have some way to make it display whatever text is there in
the button, in a larger font size?
to set the horizontal alignment, if I am giving
button[gridY1][gridX1].setHorizontalAlignment(0);
it is still appearing at the centre. what are the options
for (int) are not shown in the tutorial.
Thanks.
-Rawat
- 8
- Java Printing API and Tobit FaxWareThis example for the Java Printing API
http://java.sun.com/products/java-media/2D/forDevelopers/sdk12print.html#printable
creates different output in Suns JRE 1.4 and 1.5 (tested with Windows
2000). This can be easily checked using the 'print to file' option.
The different behaviour of the new 1.5 JRE is causing problems with the
Tobit FaxWare printer driver.
Tobit FaxWare detects special command strings in the document, which
start with @@, followed by a command name and optionally a space
character ($20, #32) and a character, finally @@ again. For example, the
receiver fax number is encoded as @@NUMMER +4996421@@. If a document is
printed on the FaxWare printer driver using JRE 1.4, the document will
be sent as a Fax to this number.
In JRE 1.5 however, the printer output contains the character $a0 (#160)
instead of space, this is causing an error message in Tobit FaxWare.
I would like to find the reason for this change but could not find
information in the JRE 1.5 releasenotes
(http://java.sun.com/j2se/1.5.0/compatibility.html#incompatibilities),
is there another place where i could find informations about the
background of this change?
Many thanks in advance,
Michael
- 8
- Eclipse jboss toolsHi,
has been any efforts to ports jboss tools plugin for Eclipse?
It contains some parts written in C (i think having to do with GUI editors).
Using eclipse-devel 3.3.2 and jboss tools 2.1.1 (previously known as JBossIDE and
now commercially named as "Jboss developer studio).
Installing the jboss tools plugins from within eclipse, asis, results in a highly unstable eclipse
environment.
Any ideas?
--
Achilleas Mantzios
- 10
- Swing Threading issue?Hi,
My UI hangs whenever I m trying do something without threading. I'm
quite amatuer with threads and need help please.
How can i make my UI thread safe?
THANKS!
/**
*
* @author Ho Wai Kit
*/
import java.net.*;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
public class Stratego extends JFrame implements ActionListener{
private static final int ROWS = 5;
private static final int COLUMNS = 5;
private final Card[][] cards = new Card[ROWS][COLUMNS];
private JPanel centerPnl, boardPnl, rightPnl;
private Client clientGame=null;
private Server serverGame=null;
private AIGame aiGame=null;
private Socket con;
boolean isStarted, isConnected, isClient, isServer;
private Card inHand, target;
private String otherHostname = "";
private JLabel statusLbl;
private JMenuItem menuItemNewGame;
private JMenuItem menuItemLoadFile;
private JMenuItem menuItemSave;
private JMenuItem menuItemSaveAs;
private JMenuItem menuItemConnect;
private JMenuItem menuItemCloseConnection;
private ConnectionManager conMan;
private GameLogic gl;
private Protocol protocol;
DataOutputStream output;
DataInputStream input;
private char[] pieces = {Card.FLAG, Card.BOMB, Card.BOMB,
Card.MARSHAL, Card.MINER, Card.CAPTAIN, Card.GENERAL, Card.CAPTAIN,
Card.GENERAL, Card.SPY};
/** Creates a new instance of Stratego */
public Stratego(){
super("Stratego");
initCenterPnl();
conMan = new ConnectionManager();
//menu bar
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu gameMenu = new JMenu("File");
JMenu settingsMenu = new JMenu("Network");
menuBar.add(gameMenu);
menuBar.add(settingsMenu);
menuItemNewGame = new JMenuItem("New game");
menuItemNewGame.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
playAIGame();
}
});
gameMenu.add(menuItemNewGame);
menuItemLoadFile = new JMenuItem("Load file...");
menuItemLoadFile.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
//if (isFileChanged())
// askForSaving();
JFileChooser fileChooser = new JFileChooser();
//fileChooser.setCurrentDirectory(new
java.io.File(fileChooserDir));
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
fileChooser.resetChoosableFileFilters();
//fileChooser.addChoosableFileFilter(new
PGNFileFilter());
int choice = fileChooser.showOpenDialog(null);
if (choice == JFileChooser.APPROVE_OPTION) {
//loadFile(fileChooser.getSelectedFile());
//fileName =
fileChooser.getSelectedFile().getName();
//setTitle(TITLE + " - " + fileName);
//fileIsChanged = false;
}
}
});
gameMenu.add(menuItemLoadFile);
menuItemSave = new JMenuItem("Save");
menuItemSave.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
//if (fileName != null && fileName.length() > 0) {
// save(fileName, false);
//} else {
// saveAs();
// }
}
});
gameMenu.add(menuItemSave);
menuItemSaveAs = new JMenuItem("Save as...");
menuItemSaveAs.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
// saveAs();
}
});
gameMenu.add(menuItemSaveAs);
gameMenu.addSeparator();
JMenuItem item2 = new JMenuItem("Exit");
item2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
if (clientGame!=null||serverGame!=null) {
int choice =
JOptionPane.showConfirmDialog(null, "Are you
sure?", "Close connection?", JOptionPane.YES_NO_OPTION);
if (choice == JOptionPane.YES_OPTION) {
closeConnections();
} else
return;
}
System.exit(0);
}
});
gameMenu.add(item2);
JMenuItem serverSettingsItem = new JMenuItem("Host Game");
serverSettingsItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
playGameAsHost();
}
});
settingsMenu.add(serverSettingsItem);
menuItemConnect = new JMenuItem("Join Game");
menuItemConnect.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
String input = JOptionPane.showInputDialog(null,
"Connect to IP : ");
if(input.trim().equals("")||input==null){
JOptionPane.showMessageDialog(null, "No IP
specified", "Error", JOptionPane.ERROR_MESSAGE);
}else{
playGameAsClient(input);
}
}
});
settingsMenu.add(menuItemConnect);
menuItemCloseConnection = new JMenuItem("Close connection");
menuItemCloseConnection.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
int choice =
JOptionPane.showConfirmDialog(
null,
"Are you sure?",
"Close connection?",
JOptionPane.YES_NO_OPTION);
if (choice == JOptionPane.YES_OPTION) {
//boardConnector.closeConnection();
//connectionClosed();
}
}
});
settingsMenu.add(menuItemCloseConnection);
menuItemCloseConnection.setEnabled(false);
//end of menu
Container c = getContentPane();
c.setLayout(new BoxLayout(c, BoxLayout.Y_AXIS));
c.add(centerPnl, BorderLayout.CENTER);
}
public void initCenterPnl(){
centerPnl = new JPanel();
centerPnl.setLayout(new BoxLayout(centerPnl,
BoxLayout.X_AXIS));
boardPnl = new JPanel();
fillBoard();
boardPnl.setSize(450, 450);
boardPnl.setMinimumSize(new Dimension(450, 450));
boardPnl.setMaximumSize(new Dimension(450, 450));
initRightPnl();
centerPnl.add(boardPnl);
centerPnl.add(rightPnl);
}
public void initRightPnl(){
rightPnl = new JPanel();
statusLbl = new JLabel();
rightPnl.setBorder(BorderFactory.createTitledBorder("Game
Status"));
//rightPnl.setSize(100, 450);
rightPnl.add(statusLbl);
rightPnl.setMinimumSize(new Dimension(250, 450));
rightPnl.setMaximumSize(new Dimension(250, 450));
}
public void fillBoard(){
boardPnl.setLayout(new GridLayout(ROWS, COLUMNS, 1, 1));
boardPnl.setBorder(BorderFactory.createTitledBorder("Board"));
for(int i = 0; i < ROWS; i++)
{
for(int j = 0; j < COLUMNS; j++)
{
cards[i][j] = new Card(Card.GRASS, i, j);
cards[i][j].addActionListener(this);
cards[i][j].setXCoordinate(i);
cards[i][j].setYCoordinate(j);
boardPnl.add(cards[i][j]);
}
}
//initialise water
cards[2][2].setCardType(Card.WATER);
cards[2][2].drawImage(Card.WATER);
}
public void closeConnections(){
if(isServer&&isConnected){
conMan.allDone = true;
isServer = false;
}else if(isClient&&isConnected){
isServer = false;
}
try{
con.close();
}catch(Exception e){
e.printStackTrace();
}
isConnected = false;
}
public void playAIGame(){
newGameBoard();
aiGame = new AIGame(cards, this);
System.out.println("AI game started");
isStarted = true;
placeCards(cards, Card.RED_PLAYER);
}
public void playGameAsHost(){
try {
JDialog notify = new JDialog();
conMan.start();
JLabel notifyLbl = new JLabel("Listening for connection...
...\n", 0);
notify.setTitle("Server IP : "
+InetAddress.getLocalHost().getHostAddress());
notify.getContentPane().setLayout(new FlowLayout());
notify.getContentPane().add(notifyLbl);
notify.setLocation (400, 300);
notify.setSize (250, 90);
notify.setVisible(true);
//ServerSocket server = new
ServerSocket(ConnectionManager.PORT_NO,
ConnectionManager.MAX_CONNECTIONS);
while(true){
con = conMan.getConnection();
//con = server.accept();
if(con!=null){
notify.dispose();
break;
}
}
isServer = true;
isConnected = true;
//serverGame = new Server(this, con);
System.out.println("Hosting Game");
isStarted = true;
placeCards(cards, Card.RED_PLAYER);
//repaint();
protocol = new Protocol(con, this);
input = new DataInputStream(con.getInputStream());
output = new DataOutputStream(con.getOutputStream());
InputReader inReader = new InputReader(input, protocol);
inReader.start();
//gl = new GameLogic(this, protocol);
sendMessage("server cone");
//readInput();
}catch(Exception e){
e.printStackTrace();
}
}
public void playGameAsClient(String ip){
try{
con = new Socket(InetAddress.getByName(ip),
ConnectionManager.PORT_NO);
if(con.isConnected()){
isConnected = true;
isClient = true;
System.out.println("Joining game");
isStarted = true;
placeCards(cards, Card.BLUE_PLAYER);
//repaint();
//clientGame = new Client(this, con);
protocol = new Protocol(con, this);
//gl = new GameLogic(this, protocol);
input = new DataInputStream(con.getInputStream());
output = new DataOutputStream(con.getOutputStream());
//usage of thread to read data (works)
InputReader inReader = new InputReader(input,
protocol);
inReader.start();
//end
sendMessage(Protocol.ATTACK_NOTIFICATION);
//without implementing a thread(does not work)
//readInput();
}else{
JOptionPane.showMessageDialog(null, "Connection cannot
be established.\nServer might not be active.", "Error",
JOptionPane.ERROR_MESSAGE);
}
}catch(Exception e){
e.printStackTrace();
}
}
//place the cards automatically(testing)
public void placeCards(Card[][] cards, String playerColor){
int k=0;
for(int i = 3; i < 5; i++){
for(int j = 0; j < COLUMNS; j++){
cards[i][j].setExposed(false);
cards[i][j].setOwn(true);
cards[i][j].setCardType(pieces[k]);
cards[i][j].setPlayerColor(playerColor);
cards[i][j].drawImage(pieces[k], playerColor, true,
false);
k++;
}
}
}
public void wonGame(){
if(aiGame!=null){
aiGame.killAI();
aiGame=null;
}
//clientGame=null;
//serverGame=null;
}
private void lostGame(){
}
public void newGameBoard(){
for(int i = 0; i < ROWS; i++){
for(int j = 0; j < COLUMNS; j++){
emptyField(cards[i][j], cards);
}
}
cards[2][2].setCardType(Card.WATER);
cards[2][2].drawImage(Card.WATER);
}
public void emptyField(Card inHand, Card[][] cards){
int x = inHand.getXCoordinate();
int y = inHand.getYCoordinate();
cards[x][y].setCardType(Card.GRASS);
cards[x][y].setExposed(false);
cards[x][y].setOwn(false);
cards[x][y].drawImage(Card.GRASS);
cards[x][y].setSelected(false);
cards[x][y].setPlayerColor(Card.NULL_PLAYER);
}
public void sendMessageToLbl(String msg){
statusLbl.setText(msg);
}
public void actionPerformed(ActionEvent e){
Card card = null;
if(isStarted){
card = (Card)e.getSource();
if(aiGame!=null){
if(card.getCardType()!=Card.WATER){
if((inHand==null||inHand==card)&&card.isOwn()){
if(card.getCardType()!=Card.BOMB&&card.getCardType()!=Card.FLAG){
inHand = aiGame.selectCard(card, cards);
}
}else{
target=card;
if(aiGame.move(inHand, target, cards)){
inHand=null;
target=null;
}
}
}
}else if(isConnected){
if(card.getCardType()!=Card.WATER){
if((inHand==null||inHand==card)&&card.isOwn()){
if(card.getCardType()!=Card.BOMB&&card.getCardType()!=Card.FLAG){
inHand = gl.selectCard(card, cards);
}
}else{
target=card;
if(gl.move(inHand, target, cards,
Card.BLUE_PLAYER)){
inHand=null;
target=null;
}else{
JOptionPane.showMessageDialog(null, "You cannot
move back and forth between two tiles for three consecutive
turns!\nPlease try again.", "Invalid move", JOptionPane.ERROR_MESSAGE);
}
}
}
}
}
repaint();
}
public void paint(Graphics g){
super.paint(g);
}
public static void main(String args[]) {
JFrame.setDefaultLookAndFeelDecorated(true);
Stratego t = new Stratego();
try{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}catch(Exception e){
}
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.setSize(600, 500);
//t.setResizable(false);
t.setVisible(true);
}
public void sendMessage(String msg){
try{
output.writeUTF(msg);
output.flush();
}catch(Exception e){
e.printStackTrace();
}
}
public void readInput(){
while(true){
String msg="";
try{
msg = input.readUTF();
}catch(Exception e){
}
if(msg!=null&&!msg.equals("")){
System.out.println(msg);
protocol.handleInput(msg);
msg="";
}
}
}
}
- 11
- record numbersMaybe my question is stupid and wrong but I hope that you will understand.
So, image that you need to create web application which will used by many
peoples in one LAN. They processing some documents and every person has the
particular number of documents in particular order (1. person has documents
from 1 to 100, second from 101 to 200 etc), which process with the
particular number (first document -> number 1 in a database). If they all
work in a same time, what is the easiest and the most safety way to manage
that? Adding number manually is the logical solution but if 2 person put the
same number, can they freeze the database or databases are imune on that ?
- 11
- HTTP creepIf you look at the packet headers going back and forth to your HTTP
server, you will discover a HECK of a lot of blather that really is
not doing much.
It is made worse by it all being human readable without abbreviations.
Add this overhead up on all packet headers being transferred each day
and you see a stupendous waste of bandwidth.
HTTP should be put on a diet, with rigid defaults, bitfield headers,
and compressed messages.
The original protocol was designed for maximum flexibility. Now we
have some experience, we can tighten it up.
It matters now that you have tiny handhelds trying to surf the net
over limited bandwidth.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
- 13
- "cannot find CactusTask" errorHello:
I am attempting to use the <cactifywar> and <cactus > tasks in an Ant
build file. I have set up <taskdef> element to point to all the
necessary jar files, including cactus-ant-1.6.1.jar as below:
<taskdef resource="cactus.tasks">
<path>
<pathelement location="${lib}/cactus-ant-1.6.1.jar"/>
and so on and so on.
</path>
</taskdef>
The CactusTask class is inside cactus-ant-1.6.1.jar but upon execution
I received the following error:
"cannot find org.apache.cactus.integration.ant.CactusTask"
Well, Ant must have found "cactus.tasks" inside cactus-ant-1.6.1.jar
or else it wouldn't have known the classname in the error message!
Now . . . junit.jar is also on my classpath. Is there a difference
between the junit.jar that comes with Cactus and the jar named
ant-junit.jar that comes with Ant? I put both in my classpath but to
no avail.
Help!
Eric Hamacher
email***@***.com
Madison, Wisconsin
- 13
- Array List IssueI have been having this unique issue with Array List I am trying add
say about 10 Objects in an Array List and conevr that to an Array.
Later when I parse through the Array i am having an Array of length 10
however i am only having the same element for all the 10 of them. can
anyone out there throw some light onto what i am doing wrong here here
is the peice of Code I am using
Course course = null;
for(int i=0;i<10;i++){
course = new Course();
course.setCourseName( "Course ".concat(Integer.toString(i)));
aList.add(course);
System.out.println(course.getCourseName());
}
Course[] courses = (Course[]) aList.toArray(new Course[0]);
Thanks
Sri
- 14
- A Pixel Matching Problemthis problem is like a miniature OCR problem.
Let's say you have some images that contain text, or screen snapshots
obtained by the Robot class. How can you extract the text from them?
You have the advantage that you probably have access to the fonts used
to create the text.
How might you go about creating an OCR for images? I was thinking of
writing this up as a student project.
The advantage you have over true OCR is all matches will be exact.
The complications are a variety of colours for foreground/background,
antialiasing and painting over muticoloured backgrounds. For JPGs you
may not have the fonts used. The edges of the text may be tweaked in
various ways, e.g. 3D, blurred, warped.
I thought you might proceed like this:
1. find rectangular regions containing only two colours.
2. draw an e in 10 font sizes for each font as your search templates.
3. look for a hole the right shape. When you find one, check all the
e's you have with that size/shape hole to see if you have a match on
the entire letter, check the whole rectangle.
4. if you have a match, calculate the baseline and starting point. now
draw a template ea in that same font and compare. If it fails try eb
etc. Work your way both left and right pulling that line.
You might construct a hashMap indexed by a digest of the glyph so you
can more rapidly check for matches. Your digest algorithm might trim
the glyph top/bottom/left/right so you don't need the stringWidth
information by actually drawing the character pair.
5. You carve the rectangle out of the bigger one, and break the
remaining into rectangles.
6. repeat until there are no more rectangles.
7. export the text each labelled with x.y where it was found.
8. In another program allow the user to highlight text, e.g. a column
or box to determine the linear order of the text desired.
Potential uses for such software include:
1. capturing filenames, error messages, crash locations that were
displayed in a non-cut/pasteable way.
2. by people trying to defeat my email munger. See
http://mindprod.com/applets/masker.html
3. by blind people extracting textual information from images.
4. To allow you to copy from any Swing Component.
5. to extract information from a screen snapshot without having to
retype it.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 14
- java script problems XP dpreview and other sitesMainly on the popular digital photo site dpreview.com but
unfortunately not restricted to this site I sooner or later run into
the problem that the site navigation and posting does not work any
more: Normally a list of available sub items is displayed on the left
side, when positioning the cursor on any a specific pull down pops up.
But every other week or so the site is displayed with an empty
background where the menu normaly is and therefore no further
navigation ist possible. I Opera I get the menus but when I click the
javascript enabled send button for posts nothing happens too.
I am running Windos XP Home with all current updates with Norton
Internet Security 2002 and Norton System Works 2002. Even after a
clean reinstall of all apps with all updates I don't get a stable
system. My only rescue so far is to load a system partion image of a
good status some weeks ago. But as I said, this does not last for
long.
I tried reinstalling Windows Script 5.6, but it did not help.
Albert
- 15
- socket & JVMThis is a multi-part message in MIME format.
Hi i'm trying to create a some sort of JAVA print server:
I've a machine that accept (throught a socket) some spool file........
Here's the JAVA code:
ServerSocket TServer;
int i = 0;
try{
TServer = new ServerSocket(TPort);
while( true ){
//frame.TModel.addElement("+++ WAITING REQUEST " + i );
Lpd_request request = new Lpd_request(TServer.accept(),frame,PQ,NumQueue);
request.start();
i = i + 1;
}
}
the problem is: every request launch another JVM for handle the print and create a pdf of the the spool data: for some reason if i create a batch that launch 5 spool file one after the other, the print server launch 5 thread, but some thread terminate not correctly.
In particular the exit code are 1-0-1-0-0 so the first fail, the second is executed and so on.....
Can I put a delay between thread execution for solve the problem???
Any suggestion????
--
---------------------------------------------
Mauro Anceschi
IT Department
Global Service Srl
Gruppo Motor Power Company Srl
www.motorpowergroup.com
Tel +39-0522-688189
Fax +39-0522-683552
IMPORTANT: This e-mail message is intended only for the named recipient(s) above and may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this e-mail message.
--------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Hi i'm trying to create a some sort of JAVA print
server:</FONT></DIV>
<DIV><FONT face=Arial size=2>I've a machine that accept (throught a socket) some
spool file........</FONT></DIV>
<DIV><FONT face=Arial size=2>Here's the JAVA code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<P><FONT face=Arial size=2>ServerSocket TServer;</FONT></P>
<P><FONT face=Arial size=2>int i = 0;</FONT></P>
<P><FONT face=Arial size=2>try</FONT><FONT face=Arial size=2>{</FONT></P>
<P><FONT face=Arial size=2> TServer = new
ServerSocket(TPort);</FONT></P>
<P><FONT face=Arial size=2> while( true )</FONT><FONT
face=Arial size=2>{</FONT></P>
<P><FONT face=Arial size=2>
//frame.TModel.addElement("+++ WAITING REQUEST " + i );</FONT></P>
<P><FONT face=Arial size=2> Lpd_request
request = new Lpd_request(TServer.accept(),frame,PQ,NumQueue);</FONT></P>
<P><FONT face=Arial size=2>
request.start();</FONT></P>
<P><FONT face=Arial size=2> i = i +
1;</FONT></P>
<P><FONT face=Arial size=2> }</FONT></P>
<P><FONT face=Arial size=2>}</FONT></P></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>the problem is: every request launch another JVM
for handle the print and create a pdf of the the spool data: for some reason if
i create a batch that launch 5 spool file one after the
other, the print server launch 5 thread, but some thread
terminate not correctly.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In particular the exit code are 1-0-1-0-0 so the
first fail, the second is executed and so on.....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Can I put a delay between thread execution for
solve the problem???</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any suggestion????</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR><FONT
face=Arial size=2>--
<BR>---------------------------------------------<BR> <BR>Mauro
Anceschi<BR>IT Department<BR> <BR>Global Service Srl<BR>Gruppo Motor Power
Company Srl<BR></FONT><A href="http://www.motorpowergroup.com"><FONT face=Arial
size=2>www.motorpowergroup.com</FONT></A><BR><FONT face=Arial size=2>Tel
+39-0522-688189<BR>Fax +39-0522-683552<BR> <BR> <BR>IMPORTANT: This
e-mail message is intended only for the named recipient(s) above and may contain
information that is privileged, confidential and/or exempt from disclosure under
applicable law. If you have received this message in error, or are not the named
recipient(s), please immediately notify the sender and delete this e-mail
message.<BR> --------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>
- 16
- awt default toolkitThe following will not show the image nor will it throw any exceptions. Not
throwing exceptions doesn't surprise me because the documentation show that
it won't. That is a little surprising in itself. I am not using Swing
components.
public void paint(Graphics g){
String fileName = "dir/a.gif";
Toolkit toolkit = Toolkit.getDefaultToolkit();
Image img = toolkit.getImage(fileName);
// an awt panel's Graphics context doesnot show the image
g.drawImage(img, 0,0, null);
//this works fine
g.drawString("aString",50,50);
}
thanks, mike
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
- 16
- Fax QuestionHas anyone used 'RFax 1.0 - Java [TM] fax component' from
http://www.java4less.com/java_fax.htm?
Good or bad (other comments)?
thanks!
- 16
- Going to NMU jikes (C++ ABI update)
I'm notice on <URL:http://people.debian.org/~mfurr/gxx/rebuild.html>
that jikes need a rebuild due to the new C++ ABI. I asked on
#debian-java if anyone is working on that, but got no reply. It is a
build-dependency on 119 packages, so it is probably a good idea to do
it quickly. I plan to do the NMU myself shortly, so this is just an
warning email.
I only change debian/changelog, adding this entry:
jikes (1:1.22-2.1) unstable; urgency=low
* Non-maintainer upload to get a rebuild with the new C++ ABI.
-- Petter Reinholdtsen <email***@***.com> Fri, 22 Jul 2005 01:08:42 +0200
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 16
|
| Author |
Message |
Andrey Romanenko

|
Posted: 2004-10-7 17:53:00 |
Top |
java-programmer, _scripting engines for java applications_
Hi All,
I've written java app with classes that strickly corresponds to user's
business domain. Now I want to add scripting feature to my program to
enable user to create own scenarios of processing objects of those
business classes. Where to start? Is there any scripting languages
implemented in java?
thanks,
Andrey
|
| |
|
| |
 |
Chris Uppal

|
Posted: 2004-10-7 18:22:00 |
Top |
java-programmer >> _scripting engines for java applications_
Andrey Romanenko wrote:
> Is there any scripting languages implemented in java?
Several, some are:
Groovy: http://groovy.codehaus.org/
Jython: http://www.jython.org/
Kawa: http://www.gnu.org/software/kawa/
And then there are interpreters that use a flavour of Java; these don't
particularly interest me, but two are:
BeanShell: http://www.beanshell.org/
DynamicJava: http://koala.ilog.fr/djava/
-- chris
|
| |
|
| |
 |
Will Hartung

|
Posted: 2004-10-8 0:52:00 |
Top |
java-programmer >> _scripting engines for java applications_
"Chris Uppal" <email***@***.com> wrote in message
news:email***@***.com...
> Andrey Romanenko wrote:
>
> > Is there any scripting languages implemented in java?
>
> Several, some are:
>
> Groovy: http://groovy.codehaus.org/
> Jython: http://www.jython.org/
> Kawa: http://www.gnu.org/software/kawa/
>
> And then there are interpreters that use a flavour of Java; these don't
> particularly interest me, but two are:
>
> BeanShell: http://www.beanshell.org/
> DynamicJava: http://koala.ilog.fr/djava/
Also JavaScript: http://www.mozilla.org/rhino/
Regards,
Will Hartung
(email***@***.com)
|
| |
|
| |
 |
konijn

|
Posted: 2004-11-2 11:06:00 |
Top |
java-programmer >> _scripting engines for java applications_
Andrey Romanenko <email***@***.com> wrote in message news:<ck33fs$kna$email***@***.com>...
> Hi All,
>
> I've written java app with classes that strickly corresponds to user's
> business domain. Now I want to add scripting feature to my program to
> enable user to create own scenarios of processing objects of those
> business classes. Where to start? Is there any scripting languages
> implemented in java?
Several. Judoscript is one, http://www.judoscript.com.
I would suggest to look into BNF (Bean Scripting Framework
(http://jakarta.apache.org/bsf/index.html) )
support for your application. If you dont like one language, you
can always change to another one
>
> thanks,
>
> Andrey
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Announcement: Super 5.10 - a suite of J2EE toolsAnnouncement: Super 5.10 - a suite of J2EE tools.
Super 5.10 comes with:
SuperEnvironment
SuperLogging
SuperPeekPoke
SuperReport
SuperScheduler
SuperStress
SuperWatchdog
and SuperPatrol, as a schedule job.
The evaluation edition can be anonymously downloaded from:
http://www.ACElet.com.
Super is a component based monitor and administration tool
for EJB/J2ee. It provides built-in functionality as well as
extensions, as SuperComponents. Users can install
SuperComponents onto it, or uninstall them from it.
Super has the following functions:
* A J2EE monitor.
* A gateway to J2EE/EJB servers from different vendors.
* A framework holding user defined SuperComponents.
* A full-featured J2EE logging and J2EE tracing tool for centralized,
chronological logging.
* An EJB tool for Peeking and Poking attributes from EJBs.
* An EJB Stress test tool.
* A J2EE global environment tool.
* A J2EE report tool.
* A J2EE Scheduler tool.
* A J2EE Business patrol tool.
It is written entirely in the Java(TM) programming language.
The current version support:
* JOnAS 2.4 and 2.6
* SunONE 7.0
* Universal servers.
* Weblogic 6.1, 7.0 and 8.1
* Websphere 4.0, 5.0.2 and 5.1
* jBoss 3.0 and 3.2
********** What is new:
Version 5.10 January, 2004
Enhancement:
1. SuperScheduler 4.1: Multiple holiday set is an advanced feature
now.
This arrangement is convenient for most of users.
2. Support WebSphere 5.1.
Change:
1. SuperScheduler 4.1: Repeating "At specified times" changes from
"all
things considered" algorithm to POSIX cron compatible
implementation.
Bug fix:
1. SuperScheduler 4.1: Repeating Daily did not consider "Day time
saving",
so there were one hour shift in April and October.
Version 5.00 January, 2004
Enhancement:
1. SuperScheduler 4.00: Rewritten SuperScheduler with bug fixes and
enhancements,
including: 1. Add task duration. 2. Add Email, JMS Queue and Topic
jobs.
3. Add Retry tasks. 4. Add GUI version of Unix cron repeating.
5. Rewritten holiday facilities.
2. SuperWatchdog 1.00 with File, JMS Queue, JMS Topic and User
triggers and
the same group of actions as SuperScheduler.
3. SuperLogigng 4.01: Improved Alarm/Alert GUI.
Version 4.00 November, 2003
Enhancement:
1. Support for both native protocol (RMI-IIOP) mode and HTTP/HTTPS
(with/without proxy) protocol mode for SuperEnvironment,
SuperLogging, SuperReport and SuperScheduler.
2. SuperLogging 4.00: tracing can work on both live database and
retired database.
3. SuperReport 3.00: works for both live database and retired
database.
4. SuperScheduler 3.00: add URL job type (for Servlet/JSP). Add
DoerTalker Table Panel.
Bug fix:
1. SuperScheduler 3.00: Interval change did not take effect until
restart Super.
Version 3.00 July, 2003
Enhancement:
1. SuperLoggingLibrary 3.00: New implementation for change scope
adding "Smart" scope,
with enhancements and bug fixes.
2. SuperLoggingLibrary 3.00: Support mail server which requires user
name and password.
Add MenuTreePanel.
3. Improved GUI and document.
4. Add support to WebLogic 8.1.
Bug fix:
1. SuperScheduler 2.0: Fix a bug in FutureView for Hourly and
Minutely.
2. SuperScheduler 2.0: Startup should never be reported as missed.
3. SuperScheduler 2.0: Could not reset job for existing task in some
situation.
Version 2.20 Jan. 2003
Enhancement:
1. Add desktop and start menu shortcuts for MS-Windows.
2. Add support for SunONE 7, JOnAS 2.6 and jBoss 3.0.
3. SuperLogging 2.40: Add new sendAlarmEmail() method.
4. SuperScheduler 1.40: Add SuperSchedulerEJB for managing when
direct database is not practical; Allow user to choose
favorite logging software; Add Last day as Monthly
repeating attribute.
Change:
1. Change Unusual to PatrolAlarm. The name "Unusual" was misleading.
Bug fix:
1. SuperEnvironment 1.31: Bug fix: if database is broken, could not
open Environment Manager.
2. SuperLogging client 1.52: Annoying exception thrown when you use
JDK 1.4 (the program runs okay).
3. SuperPeekPoke 1.61: Fix bug where input object contains
java.lang.Double and alike.
4. SuperScheduler 1.40: Bug fixes in: Memory leak; Reporting
PatrolAlarm for SuperPatrol; Composite task with members;
Non-scheduled run on other host; Around edges of last
days in Monthly with holiday policy.
Version 2.10 July 2002
Enhancement:
1. SuperScheduler 1.3: Add Future View to check future schedule in
both text and Gantt-chart mode.
2. SuperScheduler 1.3: Add graphic Gantt view for monitoring task's
activities.
3. SuperEnvironment 1.3: uses new graphic package adding print and
preference facilities.
4. SuperPeekPoke 1.6: uses new graphic package adding print and
preference facilities.
5. SuperStress 1.21: uses new graphic package.
Bug fix:
1. SuperStress 1.21: fixed graphic related bugs.
Version 2.01 June 2002
Enhancement:
1. Add options for Look & Feel.
2. Preference is persistent now.
Bug fix:
1. Installation for WebLogic 7.0: extEnv may not be installed on the
right place, so SuperLibrar on the server side was not loaded and
causes other problems.
Version 2.00 June 2002
Enhancement:
1. SuperScheduler 1.2: All copies of SuperScheduler refresh themselves
when any Doer causes things to change.
2. SuperScheduler 1.2: Support default HTML browser for reading HTML
document.
3. SuperReport 1.2: Support default HTML browser for reading HTML
document.
4. Support WebLogic 7.0.
5. SuperEnvironment 1.21: Database Panel appears when it is necessary.
6. SuperEnvironment 1.21: New SuperEnvironment tour.
Bug fix:
1. WebSphere Envoy did not always list all JNDI names.
Version 1.90 May 2002
Enhancement:
1. Rewritten SuperLogging engine. Add Alarm Email on SuperLogging.
2.Rewritten SuperScheduler allowing multiple Doers. Add support to
holiday policy, effective period. Add Patrol job type as SuperPatrol.
3. Add support for both JOnAS and jBoss.
4. Add more elements on Report criteria.
Change:
1. Now, both left and right mouse clicks are the same on Table Panel:
toggle ascend and descend.
2. New log database.
Bug fix:
1. Alert email should be sent once in the interval, regarding number
of servers in the clustering.
2. Minor bug fixes to make errors handled better on SuperLogging.
3. If withFileInfo or withTimestamp are changed alone, Style Panel did
not save them.
4. Rewritten SuperLogging and SuperScheduler with many bug fixes.
Version 1.80 March 2002
Enhancement:
1. Add new component: SuperScheduler
Bug fix:
1. SuperLogging: Verbose should ignore class registration.
2. SuperLogging-tracing: an exception was thrown if the java class
without package name.
Version 1.70 January 2002
Enhancement:
1. SuperLogging: Scope can dynamically change both for upgrade to
downgrade (for weblogic 6.1, need download an application).
2. Add alias names for log threshold as new Java suggests.
3. New component: SuperReport.
Change:
1. SuperLogging: Log database parameters are specified in a properties
file, instead of EJB's deployment descriptor. It is more convenient
and it avoids some potential problems. No change for development,
easier for administration.
Bug fix:
1. Add Source Path Panel now accepts both directory and jar file.
2. Bug in SuperEnvironment example (for version 1.60 only).
Version 1.60 December 2001
Enhancement:
1. SuperPeekPoke and SuperStress can use user defined dynamic argument
list.
2. Add timeout parameter to logging access.
3. New installation program with A). Easy install. B). Remote command
line install.
4. Support EJB 2.0 for Weblogic 6.1.
5. Support SuperPeekPoke, SuperEnvironment and SuperStress for
Websphere 4.0 (SuperLogging was supported since version 1.5).
Change:
1. Poke: argument list is set at define time, not invoke time.
2. Default log database change to server mode from web server mode,
booting performance to 10-20 times.
Bug fix:
1. If the returned object is null, Peek did not handle it correctly.
2. If the value was too big, TimeSeries chart did not handle it
correctly. Now it can handle up to 1.0E300.
3. Help message was difficult to access in installation program.
4. Source code panel now both highlights and marks the line in
question (before it was only highlight using JDK 1.2, not JDK 1.3).
5. Delete an item on PeekPoke and add a new one generated an error.
Version 1.50 August, 2001
Enhancement:
1. Source code level tracing supports EJB, JSP, java helper and other
programs which are written in native languages (as long as you
write correct log messages in your application).
2. Redress supports JSP now.
3. New installation with full help document: hope it will be easier.
4. Support WebSphere 4.0
Version 1.40 June, 2001
Enhancement:
1. Add SuperEnvironment which is a Kaleidoscope with TableView,
TimeSeriesView and PieView for GlobalProperties.
GlobalProperties is an open source program from Acelet.
2. SuperPeekPoke adds Kaleidoscope with TableView, TimeSeriesView and
PieView.
Changes:
1. The structure of log database changed. You need delete old
installation and install everything new.
2. The format of time stamp of SuperLogging changed. It is not locale
dependent: better for report utilities.
3. Time stamp of SuperLogging added machine name: better for
clustering environment.
Bug fix:
1. Under JDK 1.3, when you close Trace Panel, the timer may not be
stopped and Style Panel may not show up.
Version 1.30 May, 2001
Enhancement:
1. Add ConnectionPlugin support.
2. Add support for Borland AppServer.
Version 1.20 April, 2001
Enhancement:
1. Redress with option to save a backup file
2. More data validation on Dump Panel.
3. Add uninstall for Super itself.
4. Add Log Database Panel for changing the log database parameters.
5. Register Class: you can type in name or browse on file system.
6. New tour with new examples.
Bug fix:
1. Redress: save file may fail.
2. Install Bean: some may fail due to missing manifest file. Now, it
is treated as foreign beans.
3. Installation: Both installServerSideLibrary and installLogDatabase
can be worked on the original file, do not need copy to a temporary
directory anymore.
4. PeekPoke: if there is no stub available, JNDI list would be empty
for Weblogic5-6. Now it pick up all availble ones and give warning
messages.
5. Stress: Launch>Save>Cancel generated a null pointer exception.
Changes:
1. installLogDatabase has been changed from .zip file to .jar file.
2. SuperLogging: If the log database is broken, the log methods will
not try to access the log database. It is consistent with the document
now.
3. SuperLogging will not read system properties now. You can put log
database parameters in SuperLoggingEJB's deployment descriptor.
Version 1.10 Feb., 2001
Enhancement:
1. Re-written PeekPoke with Save/Restore functions.
2. New SuperComponent: SuperStress for stress test.
3. Set a mark at the highlighted line on<font size=+0> the Source Code
Panel (as a work-a-round for JDK 1.3).</font>
4. Add support for WebLogic 6.0
Bug fix:
1. Uninstall bean does physically delete the jar file now.
2. WebLogic51 Envoy may not always list all JNDI names. This is fixed.
Version 1.00 Oct., 2000
Enhancement:
1. Support Universal server (virtual all EJB servers).
2. Add Lost and Found for JNDI names, in case you need it.
3. JNDI ComboBox is editable now, so you can PeekPoke not listed JNDI
name (mainly for Envoys which do not support JNDI list).
Version 0.90: Sept, 2000
Enhancement:
1. PeekPoke supports arbitrary objects (except for Vector, Hashtable
and alike) as input values.
2. Reworked help documents.
Bug fix:
1. Clicking Cancel button on Pace Panel set 0 to pace. It causes
further time-out.
2. MDI related bugs under JDK 1.3.
Version 0.80: Aug, 2000
Enhancement:
1. With full-featured SuperLogging.
Version 0.72: July, 2000
Bug fix:
1. Ignore unknown objects, so Weblogic5.1 can show JNDI list.
Version 0.71: July, 2000
Enhancement:
1. Re-worked peek algorithm, doing better for concurent use.
2. Add cacellable Wait dialog, showing Super is busy.
3. Add Stop button on Peek Panel.
4. Add undeploy example button.
Bug fix:
1. Deletion on Peek Panel may cause error under JDK 1.3. Now it works
for both 1.2 and 1.3
Version 0.70: July, 2000
Enhancement:
1. PeekPoke EJBs without programming.
Bug fix:
1. Did not show many windows under JDK 1.3. Now it works for both 1.2
and 1.3
Changes:
1. All changes are backward compatible, but you may need to recompile
monitor windows defined by you.
Version 0.61: June, 2000
Bug fix:
1. First time if you choose BUFFER as logging device, message will not
show.
2. Fixed LoggingPanel related bugs.
Version 0.60: May, 2000
Enhancement:
1. Add DATABASE as a logging device for persistent logging message.
2. Made alertInterval configurable.
3. Made pace for tracing configurable.
Bug fix:
1. Fixed many bugs.
Version 0.51, 0.52 and 0.53: April, 2000
Enhancement:
1. Add support to Weblogic 5.1 (support for Logging/Tracing and
user defined GUI window, not support for regular monitoring).
Bug fix:
1. Context sensitive help is available for most of windows: press
F1.
2. Fix installation related problems.
Version 0.50: April, 2000
Enhancement:
1. Use JavaHelp for help system.
2. Add shutdown functionality for J2EE.
3. Add support to Weblogic 4.5 (support for Logging/Tracing and
user defined GUI window, not support for regular monitoring).
Bug fix:
1. Better exception handling for null Application.
Version 0.40: March, 2000
Enhancement:
1.New installation program, solves installation related problems.
2. Installation deploys AceletSuperApp application.
3. Add deploy/undeploy facilities.
4. Add EJB and application lists.
Change:
1.SimpleMonitorInterface: now more simple.
Version 0.30: January, 2000
Enhancement:
1. Add realm support to J2EE
2. Come with installation program: you just install what you want
the first time you run Super.
Version 0.20: January, 2000
Enhancement:
Add support to J2EE Sun-RI.
Change:
1. Replace logging device "file" with "buffer" to be
compliant to EJB 1.1. Your code do not need to change.
Version 0.10: December, 1999
Enhancement:
1. provide SimpleMonitorInterface, so GUI experience is
not necessary for developing most monitoring applications.
2. Sortable table for table based windows by mouse
click (left or right).
Version 0.01 November., 1999:
1. Bug fix: An exception thrown when log file is large.
2. Enhancement: Add tour section in Help information.
Version 0.00: October, 1999
Thanks.
- 2
- jdk1.6 - has no applet pluginHello
I cannot find the plugin that, I thought, should
come with jdk1.6.
Have I lost my mind or have they hidden it somewhere?
Thanks for your time.
dkr
- 3
- SendMailServlet example & server setup ?I tried this example :
// import the JavaMail packages
import javax.mail.*;
import javax.mail.internet.*;
// import the servlet packages
import javax.servlet.*;
import javax.servlet.http.*;
// import misc classes that we need
import java.util.*;
import java.io.*;
public class SendMailServlet extends HttpServlet {
String smtpServer;
public void init(ServletConfig config) throws ServletException
{
super.init(config);
// get the SMTP server from the servlet properties
smtpServer = config.getInitParameter("smtpServer");
}
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
// get the message parameters from the HTML page
String from = req.getParameter("from");
String to = req.getParameter("to");
String subject = req.getParameter("subject");
String text = req.getParameter("text");
PrintWriter out = res.getWriter();
res.setContentType("text/html");
try {
// set the SMTP host property value
Properties properties = System.getProperties();
properties.put("smtp.mail.yahoo.com", smtpServer);
// create a JavaMail session
Session session = Session.getInstance(properties, null);
// create a new MIME message
MimeMessage message = new MimeMessage(session);
// set the from address
Address fromAddress = new InternetAddress(from);
message.setFrom(fromAddress);
// set the to address
if (to != null) {
Address[] toAddress = InternetAddress.parse(to);
message.setRecipients(Message.RecipientType.TO, toAddress);
}
else
throw new MessagingException("No \"To\" address specified");
// set the subject
message.setSubject(subject);
// set the message body
message.setText(text);
// send the message
Transport.send(message);
out.println("Message sent successfully.");
}
catch (AddressException e) {
out.println("Invalid e-mail address.<br>" + e.getMessage());
}
catch (SendFailedException e) {
out.println("Send failed.<br>" + e.getMessage());
}
catch (MessagingException e) {
out.println("Unexpected error.<br>" + e.getMessage());
}
}
}
and got this:
type Exception report
message
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception
java.lang.NullPointerException
java.util.Hashtable.put(Hashtable.java:396)
SendMailServlet.doPost(SendMailServlet.java:40)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
with : properties.put("smtp.mail.yahoo.com", smtpServer);in line
40.That is my first servlet so if you be so kind to give me a detailed
answer.
- 4
- javax.mail truncated urlHi!
I use javax.mail to send http mails that include urls. On some mail
clients, including Lotus iNotes, urls contained in the mail are
truncated. For example:
http://www.crappysite.com/index.html?param1=foo¶m2=bar
becomes
http://www.crappysite.com/index.html?param1
Encoding in the email is set to "quoted-printable". I tried to set it
to "base64" but it didn't resolve the problem.
Thanks!
Alex
- 5
- Site about CoffeeIf you're interested in the world of coffee, please check out
www.thecoffeeresource.com
The site will be updated somewhere this week with new content.
Thanks for your time,
TheCoffeeresource.com
- 6
- actionPerformed programmaticallyHi
Is it good way to programmatically call actionPerformed?
NewAction action = new NewAction();
action.actionPerformed(null); //maybe instead null should be something
else, but what?
Best Regards
Greg
- 7
- Get the Verb of request in jspHi Guys,
Would anyone mind telling me how to get the verb of a request in jsp?
I would like to know whether the user is using a POST or GET request.
Thanks,
James
- 8
- evaluating the computers TCP and UDP socket statesI am looking to be able to read the TCP and UDP socket states of the
computer using Java2.
I want to be able to determine when a certain TCP socket is listening
vs. connected, etc.
Does the java2 API cover this sort of ability?
thanks,
Dave Haga
p.s. just to be clear, I want to understand the state of ALL sockets,
not just the ones opened by Java. for instance, "netstat -a" on a
windows platform provides the status of all TCP and UDP sockets.
- 9
- 360degree rotation in Java2DI have a bit of a problem rotating Shapes using the Graphics2D function
rotate(theta).
My high-school trig lessons indeed tell me that sine and cosine functions go
between -90 degrees and +90 degrees (or 0 and 180, if you like), and I can
see why this means that when I call the rotate(...) function, it will not
rotate the object all the way round the whole 360 degrees.
Currently, I have a duplicate Shape object which is flipped so that for one
half of the rotation the original shape is drawn, and for the second half,
the other...
There must be a better way!
Any ideas?
Cheers :o)
Will
- 10
- [Static Classes]Hi All,
Can someone explain when and why we use 'static classes' in Java ?
Also why 'method local classes' are used and what is their significance
?
Plz reply
- 11
- Together J 5.5Hi,
once there was a "community version" of TogetherJ. I have a 5.5 on CD
from a Together Presentation long ago but I am missing the community
"licence.tg". It was free (long time ago) but no longer available now.
Anybody out there with one of theses files?
Thx,
Christian
- 12
- Basic Struts loggingI'm learning Struts and I've got a simple example app running. I wanted
to get logging working, so in the perform() method of my Action I put
the code:
ActionServlet as = getServlet();
as.log("hello world");
This compiled with no errors and ran without any problem; but the string
was not written to either of the log files catalina.out or
localhost_log.2004-09-21.txt (this is on Tomcat).
Any hints or clues about how to get simple logging working? I looked at
log4j and commons-logging but I want to start simpler.
- 13
- jdbc commit issueHi,
I'm facing some problems with the JDBC connection commit.
I'm using an Oracle8i client and server.
The jdbc library is classes12.jar
My application uses eclipse3.1 as an IDE and the jdk version is
jdk1.5.0_01
The flow of logic is such that I acquire 2 to 3 connections to my
database repository. On each of these connections some update/insert
statements
are executed (through jdbc PrepareStatement->executeUpdate())
After the update statements I issue a connection.commit() on each of
the connections where update statements are fired.
I have noticed sometimes that although connection.commit has been
issued, my DB does not have any data.
If anyone has any clue to this please let me know.
Thanks for your time.
Arti
- 14
- CLASSPATH?WinXP Pro, JRE 1.4.2_03
I've just discovered that according to my Environment Variables section of
the System icon (Control Panel), I don't have a CLASSPATH variable. I used
SET from a command prompt to confirm that this is the case. No such
variable. So how come I can run basic (UI) Java programs OK? Shouldn't
CLASSPATH be pointing to the jar file containing these basic classes I'm
using? The problem is, JMF installation instructions seem to say I should
add the path to the jar file to CLASSPATH, but how can I if I have no such
variable? {:v)
Am I missing something?
--
- 15
- Using wildcard character in web.xml in Tomcat 5I am trying to achieve the following:
<url-pattern>/a*</urlpattern> then go into servlet A. This would
include /a, /aa, /abc/123 etc.
I notice that servlet 2.4 doesn't treat * as a wildcard character in
this case. Therefore, servlet A would only be called if the URL is
exactly /a*.
I need to create this pattern for all characters and numbers except
when the path starts with '/_'. Therefore, I can not use a '/*'
notation. Can anyone suggest a workaround to this issue?
Thanks,
TC
|
|
|