brad balmer

Ranch Hand
+ Follow
since Mar 08, 2004
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 brad balmer

Not too sure what you are talking about. When creating a report you normally pass three Objects to it:
1) The .jasper
2) Map of data/parameters
3) DataSource

You can place whatever you want in #2 to pass to the report as well as any subreports.
18 years ago
I'm assuming that you are catching whatever exception is being thrown. Are you creating an ActionErrors or ActionMessages Object to hold the error?

In your action class where are you forwarding to in case there are any errors? Is the ActionForward correctly mapped in your struts-config.xml?

Many different questions come up because you didn't paste any code.
18 years ago
Do you mean that you want to be able to click on a link on your page and, without submitting the form/page, set a value in the underlying form?

I guess that I'm not too sure what your question is. If this IS your question, you may want to try using javascript to access the form value and set it to whatever you need.

Hope this helps.
18 years ago
What about trying:


There seems to be no sense in setting the Locale if you are setting the format of the number.
18 years ago
Are you trying to use other ways to log instead of the System.out classes? If so, there is also the java.util.logging.Logger class or import the commons logging jar and use the Log class in there.
18 years ago
I can see how this would only work for one number and not for say '99 99'. Your call to readLine() will take the full String value '99 99' and try to convert it to a single number. This is where your number format exception is coming from.

Without trying the code myself, what happens if you hit enter between the numbers? You may have to re-work your calls to read in the numbers to loop until you either get no data or some sort of user-defined terminator.
18 years ago
Why don't you post your web.xml. That may be helpful.
19 years ago
You should also take a look at using displaytags:
http://displaytag.sourceforge.net/

It allows you to export a table directly to Excel.
19 years ago
I'm tring to do this originally using the jakarta commons classes, but I don't have to.

I'm trying to convert a String into a Timestamp using:

ConvertUtils.register(new SqlTimestampConverter(), Timestamp.class);
try {
timestamp = (Timestamp)ConvertUtils.convert(fullStringTimestamp,
Timestamp.class);
}catch(Exception E) {
E.printStackTrace();
}

The fullStringTimestamp value is 2005-02-03 03:30.000000000

Could anybody please point me in the right direction as this is throwing a org.apache.commons.beanutils.ConversionException.

Or using any of the plain java classes?

Thanks.
19 years ago
I'm trying to convert a String into a Timestamp using:

ConvertUtils.register(new SqlTimestampConverter(), Timestamp.class);
try {
timestamp = (Timestamp)
ConvertUtils.convert(fullStringTimestamp, Timestamp.class);
}catch(Exception E) {
E.printStackTrace();
}

The fullStringTimestamp value is 2005-02-03 03:30.000000000

Could anybody please point me in the right direction as this is throwing a org.apache.commons.beanutils.ConversionException.

Thanks.
It is a toolbox of code and components that seem to pop up in most applications. So, instead of writing this yourself, you can use the commons code which is open source and has been checked over for bugs.
I'm hoping that you've already checked out:
http://jakarta.apache.org/commons/
There are two best methods:
1. Writing a filter
2. If you use Apache, enable the gzip module and let apache do it for you.
20 years ago
This is a pure guess, but:
Socket sock = new Socket();
InetAddress iAdd = sock.getLocalAddress();
System.out.println("Address: " + iAdd.getHostAddress());
20 years ago
Answers you receive on this really will depend on the individual. A lot of taglibs out there take ResultSet and the like as parameters. You can pass back this kind of object to completely decouple your db from your business logic.
My preference is when I am returning multiple rows from a database, I prefer to return ArrayLists of Beans.