Raghavan Muthu

Ranch Hand
+ Follow
since Apr 20, 2006
Raghavan likes ...
Mac MySQL Database Tomcat Server
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
17
Received in last 30 days
0
Total given
10
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Raghavan Muthu

Hearty Congratulations to all the winners Best wishes to everyone who prepares for the exam.
Welcome Kathy and Bert Hope you are having a good time.
Thank you Barry Burd for being with us in Ranch.

Heart Congratulations to all the winners!
6 years ago
Congratulations and best wishes for the next exam!
6 years ago

Ray Bell wrote: I'm still reusing code when I need a loop.
How can you explain the logic of a loop in 50 words or less?



Hey Ray, welcome to the Ranch.  Not sure about the 50 words. Let me try my best to explain.

The nested loops are useful when you want to iterate over two levels. Say for example, a 2D (Two dimensional) array which will be across rows and columns, for which you need two rounds ofi iteration. At first you would iterate on the row level. Inside each row, you still need to iterate each column on the same row (think of an excel spreadsheet or a table). You need to hold the position of row at the outer layer, until all the columns are visited in the inner layer. The looping is done here at more than one level for doing any operation on the data which is of more than one dimension.

Say for example, you have a two dimensional array of 3 rows 3 columns (3 X 3 array) having 9 elements in total. You need to visit each cell (an intersection of a row and column is called a cell) to find out the occurrence of a particular number. For which you need to do the following.

Set Count = 0
Set NumberToSearch = 5
Iterate Rows from 1 To M -- OUTER LOOP controlling the rows
 Iterate Columns from 1 to N -- INNER loop controlling the columns per row
     If Value at the cell (R, C) = 5 Then
        Increment count (set count = count + 1)
     Else
        Do Nothing. Continue with the next column in the same row if any pending
End.

Hope this helps  you get the concept. Let us know if you have any other questions.
     
6 years ago
Hey Barry Burd,

 Welcome to the Ranch. I am sure you having fun answering the questions to the ranchers.

 I could see that the book covers Java 9. As you said in another thread that it is for beginners book (like all other FOR DUMMIES series book), does the book cover ONLY the Java 9 features or it also covers the elemental features of previous Java versions - (Generics in Java 5, try-with-resources/String in Switch etc., in Java 7, Lamdas/FP in Java 8 etc.,).  

 Also I would like to know the pattern/strategy you had followed in this book. Is this going to be a book explaining the concepts alone then and there, OR a project being developed from the scratch at an incremental pace from start to end?
6 years ago
Welcome Barry Burd !!!
6 years ago

Paul Ryan wrote:Would the Headfirst Servlets book not be a little outdated?



Yes and No.

Yes -- due to the fact, if I am not wrong, HFSJ book is not upto date to cover Java EE 6/7.
No -- because the core concepts behind Servlets and JSP were never changed rather few additions are introduced in the later versions.

So, in my humble opinion it would still be the best bet!
8 years ago
Thanks Tim for your reply. For the time being, I made a work around. For my first interaction (which is just a handshake of token exchange), I had used a Http URL Connection and for the second interaction I use a http redirect, which seems to have solved the purpose. However, I would certainly want to complete this thread for my knowledge.

Tim Holloway wrote:The crossContext option should be less overhead, but as with all optimization tricks, you should first make certain that the loss in flexibility is going to be worth the risk.



This is the first time I am encountering the scenario of using crossContext and hence I am not of aware of the nuances if any. I have been searching in Internet including Apache website but nothing much to avail directly. All what I get is a precise info on the benefit of crossContext being set to true. Can you please help me out in understanding the flexibility loss that you had mentioned, along with the potential risks if any?

Tim Holloway wrote:I can only make a wild guess what might be going wrong lacking further details, but I'd suspect that the second request may not be happening under the context that you think it is.


I also had this doubt but could not complete the knots. When the first call is successfully made after obtaining the context to Server application, I am indeed obtaining the context of Client application to return the response. Do you mean to say, it is not actually happening? Let me try printing the context objects again to verify the same if it helps. Meanwhile, can you please give me any pointers on this?

Appreciate your support as always.
8 years ago
Prasad B Rao, Welcome to the Ranch!
8 years ago
The error message is indeed very helpful.



It means at run time there was a difficulty in identifying a method "add" with two double parameters (varying parameter type for each error message) that is in the class "Vektor2" belonging to the package "de.ostfalia.dgp.ss15".

Did you compile your .java file?
8 years ago
Congratulations to all the winners!
8 years ago

I have a requirement for handshaking between two different web applications (a Client and a Server - "ClientApp" and "ServerApp") in the same Tomcat Server Instance. Basically I implement a custom 2FA (Two factor authentication of my own) which involves two steps.

  • Client handshakes with the Server first for getting a token
  • Upon receiving the token from Server, the client prepares the 2FA data and sends it along with the real user data for authentication. -- This is to avoid the illegitimate requests if any.


  • My search resulted me with two different options. One is to use a Web service (irrespective of the server instances) and another was to rely on cross context by setting crossContext=true in the context.xml of Tomcat Server if both the web applications reside in the same Server.

    I have set the crossContext to true in the context.xml of my Tomcat server and the issue seemed to have got resolved. However, all was well for just one time. My requirement is to have the interaction more than once. The second time, though the Context for the "/ServerApp" is NOT null, the control does NOT get forwarded at all.

    Is there anything that I need to further to have repeated interactions between two different Web applications deployed in the same Tomcat Server Instance?

    8 years ago
    East or west, "Head First" series is the BEST!
    8 years ago