Bing Qiao

Greenhorn
+ Follow
since Oct 24, 2006
Merit badge: grant badges
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 Bing Qiao

Hello,

I've searched for a long time and couldn't find an answer.

Is there a way to have Hibernate return the InputStream instead of blob or byte[], so the data can be streamed to the web client?

Can a custom data type achieve this?

Thanks very much for your help!

Bing
Thanks very much Steve. That solved the problem.



13 years ago
String.format("$1$", "%not%");

The above statement causes UnknownFormatConversionException. I've tried replacing % with '\u0025' to no avail.

Any help will be appreciated, thanks!
13 years ago
Hi,

I'm developing a web portal that loads other web applications running on different J2ee application servers (JBoss and Glassfish, etc).

All application servers including the one the web portal resides on have their own form based JAAS authentication enabled but they all share the same users database.

The idea is as follows:
1. to have only one login page presented to users which has an iframe embedded in it for every external application and the portal. The iframe points to url that loads corresponding web application, which will be redirected to the login page of that web application.
2. a piece of javascript in the portal login page will pass user credential to individual iframes and login the user to the loaded application.

I've managed to make this work, but wonder if it's possible to have something as follows:
1. to have only the application server where the portal runs to have form based JAAS authentication enabled.
2. every external web application needs to have a filter that authenticates all incoming requests.
3. every iframe holding an external web application needs to "clone" the state of the iframe that logs into the portal application server, so its requests to its own application server will have the "state" that can be authenticated by the portal application server.
4. the aforementioned filter will authenticate incoming requests by taking the "state" out of them and checking its validity against the portal application server.

I'm quite new to the whole concept of JAAS based container authentication, so not sure if terms like "clone" and "state" make any sense here. But hope the above clarifies what I need to achieve.

Thanks very much for any input to this!

Bing
Congratulations!

I simply cannot believe that you are not able to go back and review your drag-and-drop questions!



That is really a shame! I was astonished when I realized I had to redo the whole question or nothing.

I tentatively tried one of those, and basically gave up on reviewing the rest of drag-drop questions that I was not sure of.
15 years ago
The advert and survey are still there. I filled out the survey and got a coupon together with "valid only to 21/10" yesterday.

Then I emailed them asking why they hadn't taken off the advert if the discount had ended.

I got a reply with a coupon that's claimed to be valid and I'm gonna buy the SCBCD 5 soon.
[ November 05, 2007: Message edited by: Bing Qiao ]
Not a great score, but I really thought I'd have wasted the 176.25 pounds for the test voucher plus the 21.77 pounds for K&B's book and the five days annual leave and a lot of other leisure time because I only had a week to prepare before the test and I couldn't help making time for Heroes/Stargate Atlantis/Smallville/Desperate Housewives..., Monopoly and Digg (I'm bad, I know).

I bought the book in March 2006 and managed to finish reading the first five or six chapters in half a year (not very productive and I should have been more committed than I was).

Then I bought the voucher in September 2006 and planned to finish the book and take the test in two or three months.

Then after finishing the first nine chapters in another two months a lot of things happened and I had to give up preparing the test untill ... a week ago.

I booked the test date and left work to have my annual leave.

I went though the first three chapters again which took me four days and realized there wouldn't be enough time to do the same for the rest of the book. Phoned the test centre trying a reschedule and was told not possible since the voucher was about to expire. So from the fourth chapter I only read the two-minute drills and the Self-tests, then selected topics that I had difficulties completing the corresponding questions of.

I only finished the last chapter this morning and had two hours or so left to review everything I marked as important in the book. Then I left for the test centre.

I got a cold and didn't feel very well imagining the not-passing-scenario. During the test my left foot touched (I swear I didn't kick it) the computer case, so my screen went dark. I panicked, tried to find somebody for help but nobody was there and I really doubted anybody there could help anyway. I calmed myself down and decided to give it a try myself and found out the VGA cable dropped off.

Getting back to the test I finished all the questions still having 20 minutes left. I went back to review my answers and made some changes. Then 10 minutes left and there were still about ten questions that I couldn't be sure of. But I felt I couldn't stand it anymore especially I needed to go to the toilet so I ended the test and went out to get the report. I was very glad that I passed it, indeed.

This book, Sun Certified Programmer for Java 5 Study Guide, is simply great.

I never used anything esle but this book and Java API specs (I wanted to. I got mock tests but didn't have time to do them). This book alone helped me to pass the test and get to know so much more about Java. I have been using Java for three years but as the book said I quote "experience alone will rarely get you through the exam with a passing mark."

Again, a million thanks to the authors for their great book!
[ October 29, 2007: Message edited by: Bing Qiao ]
15 years ago
Hi,

My voucher expires by the end of Octorber. After registration with Prometric with an exam date on 29th this month, I found in the confirmation email from Prometric that the registration expiration is on 9/4/2008.

I thought I had to take the exam before the voucher expired. So what's this "registration expiration" about?

Thanks!
It doesn't certify your ability to be a programmer. But at least it certifies that you do know Java programming language, to certain extent.
Sorry, but this is not in the Errata.
Page 634, a16

public static <E extends Number> List<? super E> process(List<E> nums)

A programmer wants to use this method like this:



Which pairs of declarations could be used for successful compilation?

....
C. ....

Answer:
C is wrong because the return type evaluates to List<Integer>, and that can't be assigned to a variable of type List<Number>.
....



The book is obviously correct saying that C won't compile.
But I thought List<? super E> meant both E and E's supertypes could be returned. Why must the return type evaluate to List<Integer> then?

Many thanks!
[ October 26, 2006: Message edited by: Bing Qiao ]
I think the argument type of the compare method should be the same (or compatible?) as that of the element of the array to be sorted.

But if you had another object
Boolean b5=true;
then
b4==b5 will evaluate to true because the jvm assigns the same object to bothe the references b4 and b5.(something like Strings literals in String Pool)



Good reminder!
I had doubt about that too.

But then I thought maybe it was due to the difference between Map and List.