Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

Ankur Gargg

Ranch Hand
+ Follow
since Sep 11, 2011
Ankur likes ...
jQuery Tomcat Server Java
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ankur Gargg

Does other programs have main method?
How are you running it?Ctrl+F11??
8 years ago
import java.io.PrintWriter;
import java.util.ArrayList;

public class oop
{
public static void main (String[] args)
{
ArrayList<String> lines = new ArrayList<String>();
writeArrayListToFile(lines);

}


public static void writeArrayListToFile(ArrayList<String> lines)
{

PrintWriter out = new PrintWriter("output.txt");
for(int i =0; i<lines.size(); i++)
{
out.println(lines.get(i));
}

}
}

Here is the correct program
8 years ago
in and out are not declared.
8 years ago
Hi ranchers

I am running a tomcat 6 server on a machine.

I am able to access the application deployed from Windows clients but I am not able to access application from ubuntu clients.

Do you have nay idea what else needs to be done?

Regards
Ankur Garg
9 years ago
Hi Ranchers

I am running tomcat 6 on windows x86.

I set JAVA_OPTS=-Xmx2048m in catalina.bat.

However after doing the changes and trying to start the server by running startup.bat the server did not start.

Am I missing anything?

Regards
Ankur Garg
9 years ago
I allowed incoming requests on port 80 on server.

I read somewhere some changes in server.xml.

But somehow not able to reach to the changes that need to be done..
9 years ago
Hi Ranchers

I deployed an application succesfully on Tomcat6.
I am able to access it using http://localhost//first/index.html

Howevere when I atry to access from other machines using URL
http://169.144.15.4/first/index.html(where this is my ip on which tomcat server is started)
I get operation timed out.
Can anyone tell me what I need to change and where?

Thanks
Ankur Garg
9 years ago
HI Jesper



I ran this code and the output is:->
ArrayClass-->class [I
SuperClass--->class java.lang.Object
It's an int array
Modifiers---->public abstract final
Name--->int[]
java.lang.Cloneable
java.io.Serializable
0.

So can you explain the output?I am not able to figure out from where does the "length" attribute come from even if the class created does not have any attributes.

Regards
Ankur Garg

[Edit - added code tags - see UseCodeTags for details]
9 years ago
HI Ranchers

How is Array implemented in Java?
I mean when I create an int array say like int[] intarray=new int[10]; the intarray object is of which class?
Thirdly when I saw the modifiers of the class created to represent this array the modifiers showed "public,abstract and final"..Why is that so?
Fourthly form where does the attribute length come for an array?

Regards
Ankur Garg
9 years ago
Hi Ranchers

I have one query "When does the actual instantiation of Action class happen"?

Is it done before the init() method of ActionInvocation or does it happen inside th init() method?

Regards
Ankur garg
9 years ago
Two listeneres need not be configured in web.xml namely HttpSessionBindingListener and HttpSessionActivationListener.
HI

You can use ev.getServletRequest().getAttribute("a") to get the new value thus the getValue() method has been coded to return the old value.


Regards
Ankur Garg
Hi

<filter-name>targ</filter-name>
<filter-class>Filt3</filter-class>
</filter>
<filter>
<filter-name>targ</filter-name>
<filter-class>Filt3</filter-class>
</filter>

This snipped seems wrong as you can't have two filters with the same name.
If you change the name then container will create two instances of that filter.

Regards
Ankur Garg
Hi
Hi Paul

Thanks mate.

Best wishes
Ankur Garg
Hi
HI Roberto

Thanks.

I am using Eclipse Helios with Glassfish server Open Source edition 3 which is JEE Compliant.

meanwhile I am sorry for the subject line used.

regards
Ankur Garg