Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

jyothi malapaka

Greenhorn
+ Follow
since Dec 21, 2005
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 jyothi malapaka

I meant ----The changes to variables sent to any method as arguments will not will not affect the original values because they point to two different memory locations.
for eg--
static x,y;
public static void main(String r[])
{
x=4;y=5;
method(x,y);
}
static void method(int a,int b)--->a=4;b=5;//////////////1
{
a=9;
b=5;
}
At /////1-->here x and a point to two different memory locations but the only similarity is that they have the same value. So changes to a are not reflected on x.

But in your code,x in myMethod() and x in main() both point to the same memory location.So changes to x in myMethod() were reflected on x in main().
[ December 24, 2005: Message edited by: jyothi malapaka ]
If we send the parameters i,j as arguments to myMethod() then, any changes in myMethod() would not be reflected in the main().

check this code....
public class Static
{
static{int x = 5;}
static int x,y;///1
public static void main(String args[])
{
x--;///2
myMethod(x,y);
System.out.println(x + y + ++x);}
public static void myMethod(int x,int y)
{y = x++ + ++x;}}

In this code any changes in x,y in myMethod() will still give the output as -1 because only the copy of x,y are sent to the method. These x,y in myMethod() are similar to local variables of the method.

But in your code, the static fields are used directly (u didnt send any duplicate of x,y) .So any change of x,y occuring in any method will be reflected at all the other methods.
hii could you send me your web.xml and the java file??

There might be some problem in it....
If you are sure that there is no problem in any of them ....then change the name of your SessionTest(web application) folder....
sometimes it works .....just try it..

And then restart your tomcat...refresh ur browser and check if it is present in tomcat manager...

[ December 23, 2005: Message edited by: jyothi malapaka ]
[ December 23, 2005: Message edited by: jyothi malapaka ]
18 years ago
Hi Rathi

add this code into the tomcat-users.xml
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="" roles="admin,manager"/>

After that restart ur tomcat and try to login
[ December 23, 2005: Message edited by: jyothi m ]
18 years ago
<tomcat_installation_directory>-----conf(folder)----tomcat-users.xml
tomcat_installation_directory is same as catalina-home

In the tomcat-users.xml you will find an entry similar to (may not be same)
<user username="admin" password="" roles="admin,manager"/>
Just check the exact one in your xml file.

use this username and password for getting registered as manager.

Mostly whenever there is some mistake in web.xml you will get such sort of an error. Just check it
18 years ago
Go to http://localhost:8080 and select tomcat manager.
login with the user id, password present in tomcat users for manager.
Then check if the application is running or if there is some error in it
18 years ago