Sourin K. Sen

Ranch Hand
+ Follow
since May 02, 2006
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 Sourin K. Sen

Hi,

I couldn't find an example of a tree created in FXML using scene builder with proper event handling.
Here's what I am trying to do:
I have created a TreeView using SceneBuilder and want the Tree to display the FileSystem.
I have a controller for this FXML where in the initialize method I am initializing the tree (systemTree) via the following code :


Obviously, I have a custom TreeItem class :


Now here's the problem I am facing:
The tree displays the FileSystem root as a treenode but it does not calls the event handler for the node.
There seems to be some link missing between the FilePathTreeItem and the Tree Node because of which it does not calls the handler method of FilePathTreeItem.
I just can't figure out how to link a mouse click/dblclick event on a tree node via the TreeView to the handler of that FilePathTreeItem.

Can someone please just post a simple Tree example with node event handlers via FXML?

Thanks & Regards,
Sourin
10 years ago

Hi guys,

I cleared SCWCD 5.0 exam with 91% . I am now so relieved with it as I had only 2 weeks time to prepare for it because I misjudged the voucher expiry date and was going to start preparation in this month.

But anyways, I am so glad its over.

Next Targets -> SCBCD and SCDJWS
15 years ago
It simply means that whatever is there inside the tag body, is evaluated (if EL is present and rtexprvalue is true) and then available to us (indide the doTag method) via BodyContent for further processing of that content. If we dont use BodyContent and pass null to getJspWriter().invoke() method, then the body will be written to the response stream straight away without giving us a chance of processing.

this is particularly useful for Simple Tags where you dont have any specialized methods to access the body directly unlike the Classic tag's BodyTag interface which gives us a complete method where we can get the body and process it.
tell us the outputs that you are getting prior to restarting the server and after restarting it.
Try writing this line :

after this :


and then tell us the output...

Kamal Tripathi wrote:First of all I think there is a little code issue here

has not been written as a scriptlet, instead the line should have been




I agree with Kamal. Since the bean hasn't been assigned any value as the above line is rendered as plain html, only this line itself will get printed and the last expression will call the toString() method of StringBuffer which will print nothing.
Thanks a lot Poonam. That clears up the issue of how to use it and why to use it. But still one question is left ( I haven't gone through the SCWCD Exam Spec thoroughly), is it covered on the exam?

What else is covered on the exam which is not covered by HFSJ?

I dont have much time left with me as I am going to give the exam in a few days time and so it would be very helpful for me if someone can list out the things that haven't been covered by HFSJ but are there for the exam.

Thanks a lot in advance.

Amit Prakash Singh wrote:
But option E is debatble : because as per HFSJ page - 260: "make sure your attribute class types are Serializable and you never have to worry about it.But if they�re not Serializable (which could be because one of the attribute object�s instance variables is not Serializable), have your attribute object class implement HttpSessionActivationListener and use the activation/passivation callbacks to work around it"

So object must be serializable doesn't holds true according to the comment?


E is not debatable, it IS wrong. Option B is the only correct answer.

sridhar row wrote:
Sorry to open an old thread...but I feel even B is not the right answer as BEGINNER will still be able to access resources in directory2 using HTTP methods other than GET..Please correct me if I'm wrong.


That's very true. BEGINNER can use other HTTP methods to access the resource. I think the question maker left out something in it by mistake.

Venkat Yerramsetty wrote:
Does that mean, session listeners no matter the order in the DD with mixup of context listeners will be called prior to the context listeners, and if we have a couple of session listeners then their order would have to be taken care by the developer?



Its not like the order of the session listeners doesn't matters. Just as Abhijit pointed out, the sessions listeners will be called in the reverse order of declaration of their own kind, but if a context listener precedes sessions listeners in the DD, only then the session listeners takes the precedence and it is perfectly suited.

Think about it, if a context is destroyed before the session listeners are called, what good it will be? That's why session listeners have precedence over context listeners but amongst themselves, they follow the order in which they were declared.

Ankit Garg wrote:To test this I think you'll have to make a custom doHead request to a servlet using java.net.Socket or java.net.URL class. If there is any other easier way then I don't know about it...


There surely isnt any easier method to do this. Either use these classes or some other library, but in either case, you will end up creating connections and making calls manually via code.
Option 3 sounds right but it isn't as it is not the ONLY way to have the doAfterBody() method executed. And of course, if doAfterBody() returns IterationTag.EVAL_BODY_AGAIN, it is ONE OF THE WAY to have the doAfterBody() executed, even if that means having it executed again.
It is correct. I too had stumbled upon that one and I had answered it wrongly. Later checked it and confirmed it.

Milton Ochoa wrote:can you give us, you opinion, why not is suitable


Let's say you have a search page, like google, and you want your users to be able to bookmark their search. GET is the perfect candidate for this purpose. The info is not critical and it is being submitted via a form. Saves user the tyranny of having to enter the search criteria over and over again.

Ankit Garg wrote:
Well I created a program to test this. I wrote a servlet in which I wrote some response and then included another srevlet in it. And it worked. The only thing the included servlet can't do is to set the response headers.



Whatever you did before calling the include method didn't actually commit it to the response. It only wrote it in the buffer. So, in this case, if you had called resetBuffer() after you included the other servlet, it would have worked perfectly. But had you flushed the response (ie, commit the response) before you included that servlet, you would have recieved an IllegalStateException.

The reason why an included resource doesn't have full control over the response object is so that nothing gets commited to the response before it is included. So, even the calling servlet shouldn't have commited the response before including the resource.