saravana.T kumar

Greenhorn
+ Follow
since Jul 13, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by saravana.T kumar

HI,
This is a general doubt regarding the jsp hosting services. I just finished my jsp and j2ee before months.
I find that on the internet there a only a few jsp and java hosting services, and most of them are not free hosting services.

My search acording to google relates

1.80% of Jsp hosters are paid and commercial
2.60% of hosters(difficult to find) are J2ee hosting and not a single of them is free
3.Java and jsp hosting with j2ee is costliest
(i have FOUND ONLY 1 jsp free hosting site)

(correct me if i am wrong on the above )

my doubt is that
1. java is opensource
2. java is platoform independent
2. many j2ee cotainers are available which are very productive and easy to install and more over opensource
4.most of all, the leading apache project supports java, jsp and more frameworks with plugins and support


prior to above what i have found from blog survey that about 61% hosting in IIS(windows) are
1.free hosting
2.24x7 available
3.from asp.net TO all scripting languages supported(even php)
4.and disadvantages of iss which i dont want to introduce

ques 1. then why is jsp,java so costly and no flexible options are available
ques 2. even though it has more advantages from developing to maintenece why do none of them host jsp,java. Is there any technical fact or any webguru fact I am missing or should be knowing .

Please share any information pertaining to this.
Thaking you everyone.
17 years ago
Thank you, it worked.

And why should it be kept inside packages and not in the classes folder

2.is this above thing appplicable to custom tags or all jsp files which includes classes
17 years ago
JSP
HI,
I am having an error with tomcat which says
=>
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 11 in the jsp file: /hi.jsp
test2 cannot be resolved to a type
8:
9: <%@ taglib prefix="my" uri="dog" %>
10:
11: <my:dimple/>
12:
13: </body>
14:
---------------------------------------------------------------------------
My TLD file (simple.tld) is(placed in /web-inf dir)

<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">

<tlib-version>1.2</tlib-version>
<short-name>java</short-name>
<uri>dog</uri>
<tag>
<name>dimple</name>
<tag-class>test2</tag-class>
<body-content>scriptless</body-content>
</tag>
</taglib>
-------------------------------------------------------------------------
My class file (in web-inf/classes dir)


--------------------------------------------------------------------------
My jsp file (root)

<html><body>

<%@ taglib prefix="my" uri="dog" %>

<my:dimple>
${alpha}
</my:dimple>

</body></html>

I cant get this thing working . Please help.


[BPSouther: Added code tags]
[ August 31, 2007: Message edited by: Ben Souther ]
17 years ago
JSP
Hi ,
I just have a doubt on the stream to choose whether EE or SE and i just finished my SCJP. I have done courses on SE and EE. My doubt is that, is EE a good stream to continue or SE is the one.

The reason i am asking this is because one of my friends finished scjp and he is on the developer line says that most of the companies do programming with their own scripts and interfaces(I dont know what he means).

So my guess is whether EE a good option(even though i have studied it) in current IT industry standards.

Thank you
HI,
import java.util.*;
public class test
{
public static void main(String args[])
{
List<Integer> l=new ArrayList<Integer>();
new test().hi(new ArrayList<List<? extends Number>>());
}
public void hi(List<List<? extends Number>> a)
{
a.add(new ArrayList<Integer>());
}
}
I have a doubt regarding generics , How can the above code compile
because it adds an element to <? extends Number>

import java.util.*;
public class test
{

public static void main(String args[])
{
List<Integer> l=new ArrayList<Integer>();
l.add(5);
List<Integer> q=new ArrayList<Integer>();
l.add(1);
List<List<? extends Number>> a=new ArrayList<List<? extends Number>>();
a.add(l);
a.add(q);

for(List<? extends Number> o:a)
System.out.println(o);
}
}
This example is same as the above one as you can see it adds the eleement

Please explain why does it add when it says ? (wildcards) are not supposed to make an type be added
public static void main(String args[])
{
test t=new test();
t+=null;
}

ErroR when COMPILING
An exception has occurred in the compiler (1.5.0_11). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.ArrayIndexOutOfBoundsException: 277
at com.sun.tools.javac.jvm.Code.mnem(Code.java:1791)
at com.sun.tools.javac.jvm.Code.emitop0(Code.java:804)
at com.sun.tools.javac.jvm.Gen.completeBinop(Gen.java:1977)
at com.sun.tools.javac.jvm.Gen.visitAssignop(Gen.java:1752)
at com.sun.tools.javac.tree.Tree$Assignop.accept(Tree.java:897)
at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:806)
at com.sun.tools.javac.jvm.Gen.visitExec(Gen.java:1556)
at com.sun.tools.javac.tree.Tree$Exec.accept(Tree.java:728)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:653)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:688)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:674)
at com.sun.tools.javac.jvm.Gen.genStats(Gen.java:725)
at com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:971)
at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:535)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:653)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:688)
at com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:910)
at com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:846)
at com.sun.tools.javac.tree.Tree$MethodDef.accept(Tree.java:478)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:653)
at com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2146)
at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:347)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:499)
at com.sun.tools.javac.main.Main.compile(Main.java:592)
at com.sun.tools.javac.main.Main.compile(Main.java:544)
at com.sun.tools.javac.Main.compile(Main.java:67)
at com.sun.tools.javac.Main.main(Main.java:52)

My guess is that object with null reference cant give a Compiler error.
Is anything wrong with the statement if SO please explain why is the compiler halting
Thank You.
HI, Sorry for the error in the questions IT is editited correctly now
___________________________________________________________________________

1.Static and Instance variable initializer expressions.
Cannot pass on the checked exceptions. Must catch and handle them.

2.Static Initialzer
Cannot pass on the checked exceptions. Must catch and handle them.

Q1.why cannot we pass checked exception's to static and instance VARIBLE initializer.
(The word PASS is what i cannot understand. How can someone pass exception in this context(intiliazer)).

___________________________________________________________________________

Q2.can we pass exceptions from constructor to constructor.?

___________________________________________________________________________

3.Instance initializer blocks.

Instance Initializers in anonymous classes can throw any exception

Q3.What does it mean by the above statement?

Q. IF the above code is correct then why does this not compile?
new Runnable()
{
{
synchronized(this)
{wait(); //throws checked exception
}
}//instance block
public void run()
}

___________________________________________________________________________

Please explain,Thank you

[ July 30, 2007: Message edited by: saravana.T kumar ]
[ July 30, 2007: Message edited by: saravana.T kumar ]
Thanks everyone for your explanations and Examples
Hi,
public class test extends Thread
{
public void run()
{
try{
for(int i=0;i<5;i++)
System.out.println(Thread.currentThread() + " " + i);
Thread.sleep(10000);
}
catch(Exception e){}
}

public static void main(String arg[]) throws Exception
{
Thread t=new Thread(new test(),"joe");
Thread t1=new Thread(new test(),"jo");
t.start();
t1.start();
}}

The problem in this code is that the sleep method is not suspending the execution even though i read that its a static method..
Can i use overloaded constructor in anonymous class?
No, as the anonymous class shares the superclass (popcorn) and anonymous classes have no name it is not possible.

can i use default constructor in anonymous class ?
No, only the main class constructor is used.

Why cant i invoke the sizzle method ?

Here you are getting a compilation error
popcorn p=new popcorn();
p.sizzle();

as the compiler checks for the reference type first ,
popcorn class does not have this method so it melts down.
(overiding method selection based on object happens at runtime not at compile time)
HI,
Is whizlabs and Ucertify good enough
thank all of you
Short s=new Short((Short)3);

Short y=new Short(new Short((Short)4));


Please Explain why it is not compiling
HI,

binarySearch(List<? extends Comparable<? super T>>

checkedMap(Map<K,V> m, Class<K> keyType,)

checkedSortedSet(SortedSet<E> s, Class<E> type)

these methods were taken from the collections class

MY doubt is the arguments
1.List<? extends Comparable<? super T>
2.checkedMap(Map<K,V> m, Class<K> keyType,)
3.(SortedSet<E> s, Class<E> type)

In this forum i read that <E> is for numeric types is it true?


and please explain what these arugments types expect.
public class Delta {
static boolean foo(char c) {
System.out.print(c);
return true;
}
static void foo2(char c) {
System.out.print(c);
}
static Object foo3(char c) {
System.out.print(c);
return null;
}
public static void main( String[] argv ) {
int i =0;
Delta d=new Delta();

for ( foo('A'); foo('B')&&(i<2); foo2('C'),foo3('C'),Math.ceil(5.4)){
i++ ;

foo('D');
}
}
}

The only difference is That the iteration part is just an execution part
when you compile
1.the compiler check whether the method argument list are correct
(not return signatures)(example above)
2.IF a operator is encountered it is evaluated
i<2000 is very different from a++ (or any iteration)
SO it wont compile

Just make it simple
for (intiliaze , evaulation(checks for return type), iteration(just execute not evaulate)


for ( foo('A'); foo2('B') // this wont compile becoz
you can figure this out