Prasad Shindikar

Ranch Hand
+ Follow
since Feb 18, 2007
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 Prasad Shindikar

@Dharmakumar

2.In the Spring config file add the mapping for this url
<bean name="/addEmployee.do" class="<give your controller class location with full package structure>"/>


If I do this, my tomcat crashes during startup with the following error


@Prasad Krishnegowda
I had earlier tried doing that, but the request addEmployee.do was being resolved to /WEB-INF/jsp/addEmployee.jsp which is my default ViewResolver configuration in spring config file.

However, I tried the same again right now and it has worked. I have no idea why it had not worked the first time and why was it going to the ViewResolver earlier.

Anyway, thanks for your help!
13 years ago
Here's my web.xml


This is my spring configuration file


PS: The BeanNameViewResolver may or may not be necessary. I was just trying a couple of things and hence have added this entry.
13 years ago
Hi Hongli Li,

Please read my earlier post.

Yes, I have a dispatcher servlet with .do pattern. However, if I add .do as the extension, it searches for the following resource /WEB-INF/jsp/addEmployee.jsp due to the View Resolver configuration.

Instead, what I want is for the link to be mapped to a Controller which is annotated with
13 years ago
Can anyone help?

I have a feeling it has probably go to do something with the View resolvers. If I change the action="addEmployee" to action="addEmployee.do", the web server goes and searches for a page /WEB-INF/jsp/addEmployee.jsp!

What I want is for the link addEmployee to be resolved to /addEmployee which I have already annotated in my controller.
13 years ago
Hi,

I am a newbie to spring mvc. I have a employee form, which after filling 'submit's to an action, which is mapped to a Java Controller. However, the method is not being invoked. Can anyone help with the same?

Please find the attached code snapshots below.

Controller method signature


jsp form


spring configuration xml - view resolver definitions


Can anyone tell me how do I invoke the Java Controller method from the .jsp page ?
13 years ago
I seemed to have forgotten the basic rule that when we use two integers for an arithmetic operation, the result is always an INT!

Thanks!

However, I am unable to understand

Operators are checked from left to right BUT with checking precedence!



What do you mean by checking precedence?
13 years ago
What is the value of the expression : 3+4-5*2/7 ?

I tried to solve it manually as follows. Since operator precedence is checked from LEFT to RIGHT of an expression, Multiplication(*) will happen first, followed by DIVIDE (/), followed by ADD(+) and finally SUBTRACT (-)

Here are the steps.
3+4-5*2/7
3+4-10/7
3+4-1.4
7-1.4
5.6

However, when I try to run the same in Java, I get the answer as 6.0

Can anyone explain, how operator precedence works?
13 years ago
cleared scbcd 5 with 88%

used the following books
ejb3 in action
mikalai zaikin's guide
ejb specs

solved sun's free assessment test - helpful in understanding a couple of things very specific to exams.

javaranch forums were also very helpful in understanding a few concepts.
13 years ago

The container serializes calls to each message-driven bean instance. Most containers will
support many instances of a message-driven bean executing concurrently; however, each
instance sees only a serialized sequence of method calls. Therefore, a message-driven bean
DOES NOT have to be coded as reentrant.


what does it mean when said

MDBs should not be coded as reentrant

Managed classes mean, the classes that are managed by the container. These can be Servlets, EJBs, JSF Backing beans etc. However, these cannot be Helper Classes that can be custom defined to provide for some specific functionality.

Since DI happens courtesy of the container, helper classes cannot access DI.

Hope this helps.
okay. so when a user is successfully authenticated, we (container) will get a security identity. till then if getCallerPrincipal is called, it will return UNAUTHENTICATED identity. Is this correct ?

Also, when and how does a container get the security context ? Did not understand this part correctly.
The question is from javabeat.net mock tests for scbcd 5.0
Supposing that I am aware of the MessageListener's class' fully qualified name, still according to the question, I don't think any snippet correctly defines a MDB. Especially since no xml descriptor is present, which can define the POJO to be an MDB.

I think, specifying the @MessageDriven annotation is also equally important, other than implement MessageListener to call a POJO as an MDB.
Imagine that you have a business interface by name 'Template'. Which of the following ways can be used by the Client Application to acquire a reference to the business interface (assuming that this interface is bound in the JNDI Context)?


Correct Answer: 4. I agree with 1 and 2.

In answer option 3, should'nt the context look up be something like

template = (Template)Context.lookup("java:comp/env/ejb/template");

Which of the following code snippets correctly declares a Message-Driven Bean by name 'TestMessageDrivenBean'?


Correct Answer: 1 Can anyone explain why ?

I think, since none of the code snippets have a @MessageDriven annotation, and an xml descriptor file is not provided as part of the question, none of the answer choices are correct.