Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Anthony Andras

Ranch Hand
+ Follow
since Nov 09, 2008
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 Anthony Andras

Rohit,

I am not 100% familiar with the Apache POI API, however is it possible to read only a limited number of records at a time, then resume reading? Separating a single file into batches of records should help improve your overall memory consumption.

In other words, you can first read the first 5000 records and perform whatever processing you require. Then read the next 5000 records, etc . . .

Hope this provides some insight.

Regards,

Anthony
The individual who composes the client side code generally is the one who runs WSDL2Java. The person who publishes the WSDL typically has no concern about how the client generates the appropriate code to call the service. This is the beauty of web services. There is no coupling between client and server implementations.

If client code generation is of interest to you, I recommend taking a read through: http://ws.apache.org/axis2/1_1_1/userguide-creatingclients.html

This page helped me significantly when being faced with the task of writing client side code to communicate to web services (using Axis2).
11 years ago
Mina,

If you are looking for a good resource on design aspects of Java and you are fairly comfortable with the language, I would say pick up a copy of the Head First Design Patterns book. Throughout my career, I have read over this book several times and I always seem to pick up a new detail every time. It is an investment that will pay off for a long time to come.

I believe Stephan also touched on a very important concept: don't be afraid. While good design is important, I have seen several programmers fall due to over-engineering a solution. Most of all, have fun - it is when you are having fun that you will yield your most brilliant solutions.
11 years ago
Zama,

Check out the following article as I believe it might help you.

http://www.devdaily.com/java/edu/qanda/pjqa00009.shtml



11 years ago
Hi All,

I am currently having an issue with RichFaces subTables. Below, I define a subTable element and attempt to associate a JSF Facet tag that represents headers for this table. The results end up yielding a subtable with no headers associated with it, only the data gets printed. I was wondering if anyone has had similar issues and what the resolution to those issues are, if there are any.

Thanks for everyone's help.

Anthony Andras


11 years ago
JSF
I want to update the thread as I figured out the answer to this question. As it turns out, when you use the RequestMapping annotation, the method that is assigned as the "RequestMapper" can actually take in a parameter that represents the HttpSession. Essentially, the signature of the method would look something like this:



One then can set attributes into the HttpSession which then acts as a cache for a particular user. I honestly feel awkward using the session as a cache. Does anyone have an idea of better caching strategies? One idea that originally crossed my mind from prior experience was to cache these variables in the service layer. However, this presents an issue since spring treats services as singletons: you end up with concurrency issues with this approach. Any input / advice would be greatly appreciated.

Thanks!

Anthony
11 years ago
Hi guys,

I am very new to Spring and am trying to figure out the API. I have the following controller class defined:




When my post method is called, it forwards it on to the confirmSubmission page. Essentially what I want to do is take my submission object and preserve it for the next forward (ex: when a user clicks "confirm" on the next page, I don't want force spring to reconstruct the object, I would like to instead just use the object that was constructed here). Is there any way I can do this? I looked into the BindingResult API and tried a few things that didn't work.

Basically, I want to prevent myself from having to write the code at line 3 in the snippet below:





Anthony
11 years ago
Hi everyone,

Wasn't sure where exactly to post this question, so my apologies if I posted it in the incorrect forum. This is more of a sanity check for me.

I have a situation where I am utilizing JaxB to unmarshall XML data into Java so we can then insert it into a database. We are currently utilizing xjc though an ANT script so these classes can be generated at run time. My code, is currently in a package com.buildInfo. The generated classes are being written out into package com.buildInfo2. If I am referencing the JaxB objects inside of a class in the com.buildInfo package, I will need imports for my com.buildInfo2 JaxB classes correct?

Thanks for taking the time to read this.
11 years ago
Hi gang,

I recently came across some feedback on some code that I wrote that mentioned I had issues with connection leaks. From what I understand, a connection leak is when you don't close a connection after you have opened it. Is this correct?

An pseudo - code example of what I was doing that caused this feedback to occur is something like the following:

DbUtils - a class that handles the closing of a connection.
DatabaseInfo = a class that holds connection data.



The methods loadSomeData and loadSomeMoreData are private methods that simply open statements and result sets, then close them in a finally block. They then throw any exceptions that occur.

I understand this is a bit abstract, and I will write up a more detailed example if need be. Thanks guys.

Anthony
While this book is not written explicitly in Java, it has been a cornerstone in my library.

http://product.half.ebay.com/Introduction-to-Algorithms_W0QQtgZinfoQQprZ73175956

With algorithm books, I believe it is more useful to have a book that is not language centric. This way, you can apply your knowledge to other languages should they emerge in your technical tool belt.

11 years ago
Bear,

You got me. I apologize for my carelessness in describing the problem. The reason why this ends up being called multiple times is because the javascript I am working with builds a "popup" division in the javascript then attaches events to the elements within that division. As a result, every time the division gets marked as visible, a method is called that attaches the appropriate event handlers. While I would love to refactor the architecture of the application to make it more elegant, there are other things on my plate. Hopefully I'll have the time to do so in the future.

Thank you very much for your feedback.

Anthony
Good morning everyone!

I am currently having an issue with jQuery event handlers that I hope someone might be able to help me with.

I currently have an html element, lets just say it has an id of "a". I also have something close to the following:



Now, I have this event handler in another javascript function: attachEvents()



By chance, this method happens to get called multiple times over the lifetime of my web page. My question is: does the .click function append to the onClick event handler or does it overwrite? If it appends, is there any way to determine if an event handler for a particular event is already defined?

Thanks to everyone in advance.

Anthony
Hi there!

So i am currently preparing for a class that I am taking starting in January and I need to decide on a language of choice for the quarter. Java is naturally my instinctual choice because it is what I know and understand best. With that, I am unsure of the limitations of Java with respect to Java Collections.

In particular, suppose we have a defined matrix of indexes and documents. The indexes can be thought of words and the documents can be thought of as text documents. I want to be able to perform a search on every document in my document collection for each index in my dictionary (words). This being a very computationally heavy (and potentially memory heavy) task, I am unsure if utilizing classes from the Collections classes make sense in doing so. I am accustomed to using Java for higher level computation. This is more lower level computation and I was curious if anyone had any input with respect to how Collections (List, Set, etc . . .) perform in this environment.

I appreciate everyone's time and effort in answering this question.

Anthony

** Maybe this should have gone in the General Java forum? I am sorry if I posted in the wrong area. **
12 years ago
Ok, Please disregard the post above. I was able to solve the issue. I was completely unaware and had an instance of Tomcat running the whole time. I didn't realize I had it installed as a service, then attempted to run the startup.bat script. I apologize to anyone who took any time to research this and assure you I will be more careful when posting next time.

Best,
Anthony
I hate to reopen an issue from a few years ago, but I am running into this issue when attempting to run tomcat under Windows 7.

One interesting thing I noticed about Windows 7 is that it doesn't define a SystemRoot environment variable as it does in XP. Does anyone have any ideas. I understand my chances of finding a solution might be scarce due to how new Windows 7 is.

I made an attempt to create a system level environment variable called SystemRoot, but that didn't seem to resolve my issue.

Thanks!
Anthony

Edit:

Note - the original post differs from my post slightly in that the exception is a bit different:



I REALLY appreciate everyone's time and energy toward this.