Abhimanyu Kumar

Greenhorn
+ Follow
since Nov 05, 2004
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 Abhimanyu Kumar

Originally posted by Mihai Radulescu:
Hallo
The explication was that a non static inner can not have a static member.



Just one sidenote. Non static inner class can have static final variables (as they are constants). For ex.


-Abhimanyu.
17 years ago

Originally posted by Mike Jeya:

I am including header.jsp and footer.jsp into Main.jsp.
Header.jsp and footer.jsp has some jsp expression tags which will get the values from variables which are declared in Main.jsp.
Thanks in Advance



Hi,
How are you including those jsp's in the Main.jsp ?
It will be better if you post your code here. Anyways, i'll give it a blind try.
If you are using <%@ include file="/jspName.jsp" %>, put it after the variable declaration in Main.jsp.
If you are using jsp:include, then it wont work as far as I know. Because, jsp:include will not copy the source into Main.jsp (as opposed to include file). It puts the o/p of the included file and not the source.
Correct me if I'm wrong.

-Abhimanyu.

Originally posted by Indiana Jones:

I have written a HTML page which has a form. Now I want that this form calls different servlets when the button is pressed, depending on the what values are selected in the form.



Hi,
Depending upon the criteria ( say values in the select box or may be values of radio buttons/ select boxes) , change the action of the form using javascript.
Hope that helps

-Abhimanyu.
17 years ago
Hi,
I came to know that " The identifier that is part of all classes is maintained in a field called serialVersionUID."
But I am not able to access this field directly (say through a print statement, like System.out.println(serialVersionUID); ). So where is this value stored ? Also, i didnt find it in the class file when i opened it with decompiler.

Thanks in advance.

Abhimanyu.
17 years ago
Thanks Yuriy,
The dummy realoadForm did the trick.

-Abhimanyu
Hi,
My apologies if this has been asked before..
I have a pop-up window and a parent window. I want to reload the parent window from the
child window. I use location.reload() to do this, but since the parent form is submitted with
post, i get a dialoge box saying "The page cannot be refreshed without resending the information. Click Retry to send the information again, or click Cancel to return to the page that you were trying to view."
the child window code which is used to refresh the parent window and then to close itself is as follows :-

function closeMe() {

<% if(request.getAttribute("closeMe") != null) { %>
window.opener.location.reload();
window.close();
<% } %>
}

Is there any way i can get rid of this ?
Thanks in advance...

Regards,
Abhimanyu.
[ November 22, 2004: Message edited by: Abhimanyu Kumar ]

Originally posted by rimzim sinha:

what is the best method to pass information between jsp
1.session variable?
2.url rewriting?
3...?

rgds
Rimzim



3) hidden variables

1) if you are putting the information in session, then remove it once the info is saved. Otherwise, it may make session heavy.

2) url rewriting will also do, but you will have to explicitly create the url ( like ?param1=<%=value%>

so for me, hidden parameters look like the best solution.
Correct me if i'm missing anything.

Oops, didnt notice you have 5 jsp's. So, if there are too many parameters, you may prefer to create one object with those parameters and set it in session. But dont forget to remove it once you are done with it.

Regards,
Abhimanyu.
[ November 18, 2004: Message edited by: Abhimanyu Kumar ]
17 years ago
JSP

Originally posted by Francesco Marchioni:
Hi all,
I'd like to use tag files to build some templates in my web pages.
My problem is that I need to pass variables at runtime


Unfortunately I cannot use standard jsp <%=myvar%> notation like this:

<% String myvar="blabla"; %>

<tags ageHeading title="<%=myvar%>" />

So which is the correct way to pass runtime parameters to tag files?
Thanks a lot
Francesco




Hi Francesco,
if you are using custom taglibs, then in the tld file , you can specify rtexprvalue = true for that parameter
eg.
<tag>
<name>TextInput</name>
<tagclass>blah.web.taglib.TextInputTag</tagclass>
<bodycontent>JSP</bodycontent>
<info>Writing text inputs</info>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>

with this tld , in jsp i have statements like
<% String myName = "Abhimanyu" ; %>

<html:TextInput name="<%=myName%>" />

Hope this helps,
Abhimanyu
17 years ago
JSP

Originally posted by manas manas:
dear friends
recently i was developing one application in which i was required to dynamically create a given number of select box depending on number selected by the user from another select box in runtime and the option of the former select box(ie select box's created dynamically ) have to be be retrive from the database which is sql.
can anybody help me solving this problem?

manash



hmm..i'll give it a try.. (i'm assuming that you are writing a jsp )
submit the form on the onchange event of the first select box (containing number of select boxes to be displayed)
get the selected value of first select box by request.getParameter()
use a while loop with this value and generate the html code to create the select boxes

something like this...

(pls take care of runtime exceptions , like NPE)
<% int noOfSelBoxes = new Integer(request.getParameter("selectBox1")).intValue();
%>
// your other html code

<% while(noOfSelBoxes >0) { %>
<tr>
// here goes your select box code
</tr>
<% noOfSelBoxes--;
} %>

Hope this helps.

Regards,
Abhimanyu
[ November 18, 2004: Message edited by: Abhimanyu Kumar ]
17 years ago
Hi,

public static void main(String[] args) throws Exception {
if (Float.NaN > Float.POSITIVE_INFINITY) {
System.out.println("Float.NaN is greater");
} else {
System.out.println("Float.POSITIVE_INFINITY is greater");
}
if (Float.POSITIVE_INFINITY > Float.NaN) {
System.out.println("Float.POSITIVE_INFINITY is greater");
} else {
System.out.println("Float.NaN is greater");
}
if(Float.POSITIVE_INFINITY == Float.NaN) {
System.out.println("both are equal");
} else {
System.out.println("both are NOT equal");
}
System.out.println(Float.NaN == Float.NaN);
}


The above code prints,
Float.POSITIVE_INFINITY is greater
Float.NaN is greater
both are NOT equal
false

Can someone pls explain this o/p to me ? Also, Float.NaN is a static field of Float wrapper class, then why is Float.NaN == Float.NaN returning false ?

TIA,
Abhimanyu

[ November 16, 2004: Message edited by: Abhimanyu Kumar ]
[ November 16, 2004: Message edited by: Abhimanyu Kumar ]
17 years ago
so if i have math.floor(5.6) WILL RETURN 6.0
math.ceil(4.3) will return 4.0
math.floor(-4.2) will return -4.0
math.ceil(-3.8) will return -3.0

-------------------------
Math.floor(double d)
returns the largest (closest to positive infinity) double value that is not greater than the argument and is equal to a mathematical integer.
5.0 being the largest double value which is not greater than 5.6 , math.floor(5.6) will print 5.0
math.floor(-4.2) will print -5.0

Similarly, Math.ceil(double d)
Returns the smallest (closest to negative infinity) double value that is not less than the argument and is equal to a mathematical integer.

math.ceil(-3.8) will print -3.0
math.ceil(4.3) will print 5.0

(Note that for negative values, -5.0 is smaller than -4.2 and -3.0 is greater than -3.8)

Regards,
Abhimanyu
Hi,
Has anyone of you used the Void wrapper class ? I read that it does not wrap any primitive data type but it is used to represent void keyword. I'm curious to see some code using this class

Thanks In Advance,
Abhimanyu
17 years ago