comp.lang.java.programmer
  Home FAQ Contact Sign in
comp.lang.java.programmer only
 
Advanced search
July 2008
motuwethfrsasuw
 123456 27
78910111213 28
14151617181920 29
21222324252627 30
28293031    31
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.java.programmer Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Why Long when parsing "5.0"?         


Author: Aaron Fude
Date: Jul 27, 2008 22:30

Does it surprise anyone that the result of the following command is a
Long rather than a Double?

new java.text.DecimalFormat("0.00").parseObject("5.0")
1 Comment
  Newbie - JSF question         


Author: zalek
Date: Jul 27, 2008 18:28

I am learning about JSF from the site http://exadel.com/tutorial/jsf/jsftutorial-kickstart.html
There is an example of JSP program:
<%%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %%>
<%%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %%>
Show full article (1.07Kb)
3 Comments
  what is the RIGHT THING to make a constructor of a subclass, using super()         


Author: Mark_Galeck
Date: Jul 27, 2008 18:17

Hello, what is the RIGHT THING, to write a constructor for a
subclass, that needs to compute arguments to the super() call?? How
do experienced and elegant Java programmers do it?

The meaning of a subclass is that it adds more to its superclass, so
for example, it can have a constructor arguments types that the
superclass does not have. With these arguments, I have to first
compute the arguments to the superclass constructor (using the
arguments supplied to the subclass), and it is hard to do all these
computations inside the call to super(). I can do it, but it is, as
one of my first programming professors once put "your code is ugly and
miserable". Since Java is a well-designed language, I must be doing
the WRONG THING, what is it, how do I do it the right way??

Thank you for your insights

Mark
14 Comments
  Re: Page Name With JSP/JSF         


Author: Arne Vajhøj
Date: Jul 27, 2008 16:23

Steve wrote:
> Is there a way to get the actual page name (e.g., myPage.jsp) in a JSP/JSF page?

Try:
request.getRequestURI()

Arne
no comments
  reading filenames from stdin - with umlauts?         


Author: Dan Stromberg
Date: Jul 27, 2008 15:54

I wrote a small java program to read filenames from stdin (produced by
Linux' "find"), and then to divide those files up into like groups.

Actually, it was originally a python program, but I've been wanting to
expand my horizons a little, so I rewrote it in perl, and now I'm trying
to redo it in java to celebrate java going opensource, and I'll likely
rewrite it in Haskell and/or Objective Caml after the java version.

The java version of the program seems to work pretty well, and I have a
feeling it's going to prove faster than the python or perl versions
(which are at http://stromberg.dnsalias.org/~strombrg/equivalence-
classes.html - and I hope to put the java version there too after it's
working a little better).

However, to my disappointment, the java version of the program can't seem
to deal with filenames that have umlauts in them. Filenames using only
characters in the English alphabet seem fine.

I suspect the problem is that the file_name_, as it appears in a Linux
ext3 filesystem, has an 8 bit per character representation, but java
wants to convert the string I read from stdin to a 16 bit per character
representation, and then doesn't reverse the conversion when I go to open
the file by its name.
Show full article (4.79Kb)
12 Comments
  Page Name With JSP/JSF         


Author: Steve
Date: Jul 27, 2008 15:50

Is there a way to get the actual page name (e.g., myPage.jsp) in a JSP/JSF page?

Steve
no comments
  OutOfMemoryError with javamail getmessage         


Author: Patrick Hahn
Date: Jul 27, 2008 14:52

Hello

In a java program, i want for statistics purpose, read one by one all messages from a Mail
Folder (it has a million messages but each of them is less than 5k).
However, after the program has retrieved a number of messages (in my case about 20000 messages),
i get an OutOfMemoryError. Even when i force a Runtime or System gc every 1000 messages,
the result is the same; it seems that garbage collection is not working and the retrieved
(and no longer used) previous messages or strings do not get freed.

Does anyone know how the program could be rewritten so that gc works and i do not get the
OutOfError?
The only workarround i found is, after every 1000 messages, to close the mail Folder, and
immediately open it again to read the next part of the messages.

Bellow is a portion of my program.

import java.io.*;
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;

public class Mail {
public static void main(String[] argv) {
int mTotal=0,mCount;
Properties mProps = System.getProperties();
mProps.put("mail.imap.timeout", "300000");
Session mSession = Session...
Show full article (2.76Kb)
10 Comments
  How to handle text/html content from Firefox copied to Clipboard under Linux         


Author: dimitrypolivaev
Date: Jul 27, 2008 14:09

Hello,

I post this mail because I need help. The problem is that text/html
content copied to clipboard by Firefox under Linux (ubuntu 8.04) is
corrupted when it is read by Java (e.g. JRE 1.6.0_07) and can not be
used. However text/html content copied by OpenOffice can be obtained
without any problem. As a consequence java based rich text editors can
not paste content from Firefox at all. Other editors like OpenOffice
manage to handle such content too.

The attached java program gets text/html content from Clipboard and
writes it to the standard output.
So you can reproduce the problem by copying parts of internet pages
shown in Firefox to clipboard, running the program and and seeing what
it turns into.

Looking forward to get any comments about this issue,
Dimitry

//-- code example begin
Show full article (2.26Kb)
12 Comments
  WHY ARE YOU STEALING MY EMAIL         


Author: kingcreole8
Date: Jul 27, 2008 10:23

WHY ARE YOU STEALING MY EMAIL ...AT
kINGCREOLE8@GMAIL.COM....THIS IS MY EMAILL ADDRESS
no comments
  INVESTORS WANTED         


Author: kingcreole8
Date: Jul 27, 2008 10:21

THIS IS A TEST...FOR LUKE METOYER
SR...EMAIL....KIngcreole8@gmail.com
no comments
1 2 3 4 5 6 7 8 9