Jorge Pinho

Greenhorn
+ Follow
since May 16, 2003
Jorge likes ...
MySQL Database PHP Tomcat Server
Merit badge: grant badges
For More
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 Jorge Pinho

Hi,

Your are mixing things up!

Javascript is NOT Java

JSP still is Java

What exactly is the HTML output of that code ?

12 years ago
JSP

Do you have experience making games in another language/platform ?

If not, you should start with making games on a simple java program. Using Swing maybe...
12 years ago

Hi Peter,

Yes, everything prints fine on WinXP...

Since the docs are in the print queue, shouldnt at least print a blank page ?

I am going to debug on production, to see if I spot something...

Hope someone has any idea...

Thank You
13 years ago
Hi Ninad, thanks for your reply...

The problem is that I dont know exactly what to post... the lines to print are everywhere on the business layer for 5 business docs, this is code:

PrinterJob pj = PrinterJob.getPrinterJob();

... lots and lots of business logic ...

job.setPrintable(invoicePainter);

try {
job.setJobName("invoice");
job.print();
} catch(....) {
loggging....
}

This piece of code is everywhere and the docs do go to the print queue... however I dont know what happens so that the docs only have 2048 bytes of size (only on the linux).

The webapp (struts 1.2.8) just calls a business class to print...

I really dont know what else to say

13 years ago

Hi all,

I am going crazy on this one...

I am not sure if this is a Java problem or a SO problem, anyway...

I have a small tomcat webapp that prints some docs on a local printer.

I can print from any other app (openOffice, gEdit, Firefox, etc...), except this one.

The docs are on print queue for a while and then they disapear...
their file size is always 2048 bytes
Absolutly no error is reported

Does anyone have any clue why is this happening ?

Is there a way to view the contents of a doc on the print queue ?

I have already printed sucessfuly from Java on that machine, from java apps and webapps.

(Linux Fedora Core 2, Java 1.4.2 and Tomcat 5.0)... I know, its old !!!

I tested on WinXP and all is OK.

Thankx,
Jorge Pinho
13 years ago
Hi Vivek,

This is not one single question...

If you want to get things from a database, you have to use JDBC.
If you want to create content that will look like tabs in a web page with specific content each, you have to use JSP/HTML.

Try creating the tabs static (plain HTML, its just a TR with TDs on it) and then create a servlet that will get things from DB and them loop over them.

It is a very vague question...
Hi K.

java -jar dist/MyClass.jar also needs a classpath...

try...
java -cp dist -jar MyClass.jar

Hope it works, or its something else, lets see...
16 years ago
Hi Casey,

Well, that is very little information...

Do you have a HTML Form with a sugestion field ?

You want to receive an email, when someone submits ?

So far, its an internet-wide question...

to send email in java, you have to use the JavaMail API, its very simple...
16 years ago
Hi John,

You have to use regular expressions...

look for...

String.matches()

and

Pattern Class, to understand Regular Expressions
16 years ago
Giving a simple example that works...

Integer i1 = new Integer(5);
Integer i2 = new Integer(5);

i1.equals(i2) <- true (Integer.equals() does the comparing logic)

i1 == i2 <- false (diferent objects)
16 years ago
Hi,

For each request there is a new thread, if a user closes the browser, the server isnt aware of that, but, when the serves ends the request, the thread dies.

If you hit refresh, your previous request was canceled, but the first thread will do its job anyway, and will die.
[ February 13, 2008: Message edited by: Jorge Pinho ]
16 years ago
Hi Deepak,

Here it goes...

The == gives true if the Objects are the same, so...

String a = "a";
String b = a;

a == b <- true

String c = "c";
String d = "c";

c == d <- false

the equals() method is a method that every class object has, so that the developer can set some logic to tell if the objects have some equality.

thats why:

String a = "a";
String b = "a";

a.equals(b) <- true
but
a == b <- false (diferent objects)

hope the helps, dont forget to see the manual, and have fun writing code
16 years ago
I took a chance doing the 5.0, I never used the news 5.0 things in real life. That was a major thing, I probably failed all the tricky generics questions.

And now... it�s all in the past.

My major reading was Sierra & Bates Book, it is very good. Althougt I think the generics chapter (and all over the net) starts the wrong way. I understood generics when I created a class and, only after that learning the declarations.

Another places I looked... Marcus Green site, and the SCJP Tiger Study Guide and the java tutorial.

Thankx all
Jorge
17 years ago
The input parameter is only relevant if you set: validate="true"

This will cause ActionForm.Validate() to be executed and if you return a populated ActionErrors Object, struts will redirect to the page, action or tile defined in "input"

HTH,
Jorge
18 years ago
... Or do I have to create a separate one with almost the same code ?

Thankx

Jorge
18 years ago