Mohan Mehra

Ranch Hand
+ Follow
since Jul 28, 2011
Merit badge: grant badges
For More
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 Mohan Mehra

nishant dahiya wrote:Hi Saif,
I am facing the same problem as above and my program is almost similar. Also my helloWorld.jsp file is inside Web-content and not web-inf. Still i am getting the error that resource not found. All my tomcat connections are fine because it shows tomcat welcome page when i go to localhost. I am new to this and have been struggling to this for last 3-4 hours. I would appreciate any help.

PS: Attached are the screenshots.


Right click on the Tomat server and click "clean". Then right click one more time and click "clean Tomcat work Directory".
Then run the web app.
8 years ago

This is my action method containing the business logic. I want to show error message from this action method in the jsp. The control goes to the jsp but the error message does not show up.In my jsp i have this code to display error message:

I am new to struts. Also in eclipse it says that saveErrors method is deprecated. i know how to display errors using validate method of the bean class which extends ActionForm.

i think i got it

thanks anyways
suppose there is a div tab:

how do i change the class value to changedClass i.e., using javascript

Paweł Baczyński wrote:

Mohan Mehra wrote:what about the return in catch?

It does not matter. If you have a return statement in finally block, this return always is executed (unless the application is closed before it reaches this return statement).

ok. but i want to know whether the return in catch runs or no. i mean when the control comes in the catch and sees the return what does it do. does it returns 9 and then the return in finally overwrites it?
9 years ago

Tushar Goel wrote:Because finally have higher precedence. It will executed at any case so whatever written in to finally be executed. So that's why you see return in finally is executed.
There is only 1 case in which finally will not be executed that's when program itself terminated before running reaching finally.

what about the return in catch?
9 years ago
consider this program :

the output is 7.

can anybody explain how the flow is working. i understand that there is a divide by zero exception after which the control goes to catch. what about the return statement in catch . why is it overriden by finally
9 years ago
hey everyone thanks for the enormous replies. helped me a lot especially the communication between Tim And Paul. Great guys. i will start working on it . make it work for one or two users and then tweak it if required. thank you everyone. great job.
10 years ago

Ulf Dittmer wrote:You need to clarify what you mean by "1000 logins at a time". 1000 concurrent user sessions is not large number; any modern server should be able handle that (assuming that the web app and the DB are performant). If you actually mean that 1000 users are accessing the server at the same instance in time -1000 concurrent requests instead of 1000 concurrent sessions- then you probably need to think about load balancing. I'm not exactly sure what a "leave management system" would be doing, but it doesn't sound particularly taxing in its complexity.

1000 users are accessing the server at the same instance in time
10 years ago
Hi, I really don't know in which section to ask this question. I thought its java based app so chose this section.

I will be building a leave management system using java,jsp, and mysql.(please tell if this is a good idea). it will be used by employees of a company with thousand strength. if all these employees use this application at once, how do i go about building it to handle such a situation.
10 years ago
done it. here the code

each thread generated will independently generate a random integer as an upper limit, and then computes and prints the no. of primes less than or equal to that upper limit .

simple program to create thread:
I know how to create threads but I need to create threads based on user input, i.e., if you mention 5 then 5 threads have to be generated. each thread has different tasks to do.
the java code runs the command prompt and passes parameters to it, and then executes. it works fine in Eclipse IDE, but when i make it as a service(in windows 7) and run it, it doesn't work. what i want to ask is will this service invoke the command prompt,pass parameters and run it. Just for reference on line code is given below.

12 years ago