Win a copy of Terraform in Action this week in the Cloud forum!

Daniel Del Moral

Ranch Hand
+ Follow
since May 24, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Daniel Del Moral


Try adding this lines in your persistence.xml file that should be inside de META-INF folder:

If the new refactored Managed Bean name is HelloTest, you should call it from helloTest from the page, not hellotest. That should work.
10 years ago

I just need to flush the PrintWriter that I returned at getWriter method of my HttpServletResponseWrapper. I just had to flush it after the Servlets have donde the writing, I did it after the doFilter on my filter.
13 years ago
I've been researching around. I override getOutputStream and getWriter in my HttpServletResponseWrapper:


This is my implementation of FilterServletOutputStream

I've noticed that JspWriter does calls getWriter from my HttpServletResponseWrapper, so I'm sure that JspWriter has my ServletOutputStream wrapper, the problem is that later, JspWriter doesn't call any of my overriden write methods, so I never get the output from jsp. Any ideas why this could be happening?

13 years ago
Hi ranchers:

I've been stucked with a problem, I'm trying to implement HttpServletResponseWrapper, so I can get a hold of the response outputstream from a filter. I'm just implementing the example from the following webpage: (Example 3 at the bottom), but it doesn't work if my request is a JSP page, the stream that I get from the wrapper is empty, but it does work if it is a outputstream from a Servlet (using getOutputStream()). I'm using Apache Tomcat 5.5. Has anybody had a similar problem? I guess it must be an additional method from HttpServletResponseWrapper that needs to be overriden, I just can't find which one it is.

13 years ago
BTW, I think I spotted an error on the exam. There was this question that of the five answers, there was only one that could remotely be right, but it had an error close to this:

(Not the actual error obviously). It got me thinking for minutes, because the other answers where completely wrong, so I marked it as the right answer. On the other hand, I got four answers wrong of 69, so I guess I'll never now if it was an actual error or I just missed something else. Has anybody else spotted errors on the exam?
13 years ago
I just passed the exam today. Three hours was more than enough time, I just used nearly two hours with carefully review of each answer. For my preparation I read Head First two times, then I studied the Java EE 5 specification and JSP specification and finally I bought the enthuware exams, which were very close to the real exam. And obviously, I often visited javaranch
13 years ago
Hi ishmayel vemuru!

I see the misunderstanding, it's all about what's returning the find method.

The find method will perfom the regex algorithm that I explained above UNTIL IT FINDS A MATCH IN THE REMAINING STRING. If it finds a match it returns true, it it don't, returns false. This is the example re-explained.

- Starts while.
- Call to m.find()

s 'a' a \d? No
Is 'b' a \d? No
Is '4' a \d? Yes
Is ' ' a \w? No
Is ' ' a \d? No
Is '5' a \d? Yes
Is '6' a \w? Yes! pattern matched! 56.

- m.find() returns true, m.start() is 4, is 56. While continues

- Call to m.find() again, it continue with the remaining string match

s '_' a \d? No
Is '7' a \d? Yes
Is 'a' a \w? Yes! pattern matched! 7b. Let's start again after the match

- m.find() returns true, m.start() is 7, is 7b. While continues

Is 'b' a \d? String ends.

- m.find() returns false, while ends.
This is kind of how the regex algorithm works:

Pattern \d\w
Matcher ab4 56_7ab

Let's start in the beginning of the matcher:

Is 'a' a \d? No, let's move on to the next character
Is 'b' a \d? No, let's move on to the next character
Is '4' a \d? Yes, so let's see what comes next
Is ' ' a \w? No, let's go back
Is ' ' a \d? No
Is '5' a \d? Yes
Is '6' a \w? Yes! pattern matched! 56. Let's start again after the match
Is '_' a \d? No
Is '7' a \d? Yes
Is 'a' a \w? Yes! pattern matched! 7b. Let's start again after the match
Is 'b' a \d? String ends. That's it.
[ June 05, 2008: Message edited by: Daniel Del Moral ]
The problem is the digit 6.

As you noticed, the first match would the 56 as is the first occurrence of a digit (\d) followed by a word character (\w). Now, as the digit 6 has already been evaluated, the search for the next match will begin exactly after the 6, therefore would be 7b.
Hi Mainak Goswami!


Well, I also passed the exam just two weeks ago, and I also tried to login to the certmanager a day after the exam, but that site takes three or four days to update your exam's info, so keep trying later. You should login to the website a soon as possible so you can confirm your mailing address, after that, they will mail you the certification pretty soon.
Static members don't have access to super() or this() calls. In order to make a call to super or this there must be an instance of the class, and since static method don't depend on instantes of the class, then there's no point in calling those methods. See that it work when you created an instance with new?

BTW, I think that when you called new Serialization().super(), the super is a call to the Object constructor, which doesn�t do what you wanted.
Congrats on passing SCJP!

Weeks ago I was in the exact same situation. It actually depends on what you want. These were my conclusions on all the certifications you can take now:

SCJD: If you want to take your SCJP one step futher. It'll take you a lot of time to do the assigment, but will certified that you actually can develop a Java app from scratch. It costs $400.

SCWCD: A test just like the SCJP, but it's about JSP and Servlets. It is the second most "popular" java certification after SCJP.

SCBCD: Just like the SCJP test, but it's about Enterprise Java Beans.

SCDJWS: Just like the SCJP test, but it's about developing Web Services.

SCMAD: Just like the SCJP test. It's not that popular and it's focus on Java Micro Edition of Mobile Applications.
Because * means zero or more ocurrences. So, it always find zero or more ocurrences of digits on a string. If you use + instead of *, it will return false because it means one or more ocurrences.
Bhupinder Singh:

sleep and wait are way different. sleep belong to the Thread class, and can be invoked Thread.sleep(1000) which mean that the current Thread will halt for 1000 miliseconds (1 second). wait is not a simple operation, because it involves locks and depends on a notify call, so I suggest you first read about synchronized methods or blocks and then read about wait.
[ May 29, 2008: Message edited by: Daniel Del Moral ]