gkumar kumar

Greenhorn
+ Follow
since May 01, 2007
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 gkumar kumar


just check the java_home path..........u need to set java_home path it may solve the problem.
chek it out
11 years ago
Hi,

In this way also we can have multiple instances of a servlet.This works and iam sure

New instances of any servlet will be created for as many times as the
servlet is named differently. For instance, all these refer to the same
servlet, but each will be a separate instance....

<servlet>
<servlet-name>MyServletName</servlet-name>
<servlet-class>com.mypackage.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServletName</servlet-name>
<url-pattern>/mymapping</url-pattern>
</servlet-mapping>


http://localhost:8080/mycontext/mymapping

http://localhost:8080/mycontext/servlet/MyServletName

http://localhost:8080/mycontext/servlet/com.mypackage.MyServlet
15 years ago
Hi,
In xml file
<servlet>
<servlet-name> servlet1 </servlet-name>
<servlet-class>com.pack.HelloServlet </servlet-class>

<servlet-name> servlet1 </servlet-name>
<url-pattern> /index </url-pattern>
</servlet>


Depending on url it calls servlet1 and then creates
HelloServlet instance.
I am not sure but read some where if

<servlet>
<servlet-name> servlet1 </servlet-name>
<servlet-class>com.pack.HelloServlet </servlet-class>

<servlet-name> servlet2 </servlet-name>
<servlet-class>com.pack.HelloServlet </servlet-class>


<servlet-name> servlet1 </servlet-name>
<url-pattern> /index </url-pattern>

<servlet-name> servlet1 </servlet-name>
<url-pattern> /welcome </url-pattern>
</servlet>


here it creates two instances of HelloServlet class.
will it work,Is it correct
15 years ago
Hi,
Check any setMaxInactiveInterval(int time) method,change value of argument
or
sometimes session inactive time is also specified in xml file using a tag
change value there.

As per my knowledge these are the two ways to get rid of the problem.
If you find any other solution just post it yaar
15 years ago
Hi,

String is an object and its not primitive data type.
StringBuffer is intialized using constructor

Ex: StringBuffer sb = new StringBuffer("Hello");
but String can be
String str="Hello" or
String str=new String("Hello");
This is the adv of string class compared to other classes.
Similarly Object is a class like StringBuffer.
methodA(null) means it will call String only
if methodA(new Object()) it will call Object
15 years ago
Hi,
If you are asking about the comments in the class file

ex:
/**
* @author ${user}
*
* ${tags}
*/

These comments we can set in eclipse at
Windows->Preferences->java->code Style->code Templetes
15 years ago
Hi,
Methods and varialbles of outer class can be accessed
directly by inner class.
But inner class variables and methods can't be accessed by outer class directly and
inorder to access, inner class should be instansiated in outer class then only inner class methods can be used.

So here we can define same function with 2 different
functionalities,just like overriding.
15 years ago
Hi,
Extract array from hashmap for the example you mentioned, code is as follows

HashMap hmap=new HashMap();
hmap.put("storeKey", new String[]{"first","second"});
String obj[]=(String[])hmap.get("storeKey");

for(int i=0;i<obj.length;i++){
System.out.println(obj[i]);
}
15 years ago