prav mane

Greenhorn
+ Follow
since Nov 21, 2001
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 prav mane

am not sure if this helps.
put the object in the session for the first time and then keep pulling it out of the session everytime you refresh.
Since this page gets refreshed throught out.
session scope can be declared as "application".
prav.

Originally posted by Mani Balasubramani:


Thanks for your reply. I am using Oracle 8i. In my case, i am not calling the same query many times in a JSP page. But I am reloading the entire JSP page, which means that i am once again creating another instance of preparedStatement object. Is there any way to avoid this?
Thanks again.

thanks..
i have
<xsl:template match="/">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
now <xsl:apply-templates/> selects all the child elements right?
I don't have any other template as well.
So is'nt this same as selecting *.
i'm totally confused.
thanks,
prav.

Originally posted by Menon Hema:
/ selects the root node of the document, whereas * selects all the elements.


hi all,
suppose we try to provide a menu like thing
for user inputs.
Now in my code i obviosuly have lots of ifs
and elses
if (input == a)
do this
else if (input == b)
do this
is there a oo way to handle this kind of a situation?
w'd command pattern help here?. If so how?.
in a servlet centric design we normally have a controller which does a look up on the busines object and forwards the request to the appropriate business obj. it does not have a if else kind of stuff.
thanks
prav.

I was just wondering,
so you must be having some kind of code like this...
void someMethod(){
try{
id= request.getParameter(<something> );
BusObj busObj = busobjHash.get(id);
...
//render it on browser using
//requestdispatcher?

}
one simple solution could be to synchronize someMethod() so that all the requests are sent in a serialized manner
But this will bring down the performance?
prav.

Originally posted by Chhaya Dhanani:
hi all,
my code works in the following manner.
i have a central controller which is a servlet.
i am using the model 2 architecture (MVC) pattern.
all request go to this servlet which sees in the properties file and calls the corresponding business object(logic which is a class).
This class returns a XML file which i have to display on the browser.
my problem is suppose another request comes before the earlier xml file is thrown on the browser, then this file is replaced.
i thought of placing this file in the session..
Is there any other better way to do this..
Certainly all u champs out there can help me on this..
Thanx in advance
Chhaya


hi!
have just started learning xslt..tell me if this solution is ok...
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="b">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
prav
hi all,
what is the difference between the 2?
I have a small xml doc:
<?xml version="1.0"?>
<player name="sachin" born="1974">
<inning score="155" year='2001'>
Rest Of World at ENG
<ground>LORDS</ground>
</inning>
<inning score="145" year='1998'>
Aussies at SHA
<ground>Sharjah</ground>
</inning>
<inning score="138" year='1998'>
Aussies at SHA
<ground>Sharjah</ground>
</inning>
<inning score="145" year='1996'>
Aussies at Sydney
<ground>SCG</ground>
</inning>
</player>
if i apply the follwing xsl,
<xsl:template match="/">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
i do not get the element names printed..only the elemnt contents..
But if i do
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
then the entire document tree gets printed.
thanks
prav

I think a class is removed from the JVM only when the classloader which loaded it in the first place has been GC-ed.
I may be wrong. In that case to do the opposite of class.forName(), you might have to write your own classloader to load the classes and make the loader's reference point to null when you want to un-register the classes loaded by it.
You classloader needs to specify it's parent as null.
if the class to be loaded is A and if it is the classpath then
the parent will end up loading it which you don't want.
So if the parent is null then your loader will get a chance to load it.
just a suggestion i may be wrong. others can probably correct me
prav

Originally posted by tsmets:
I'm currently writing the Unit test for a class which instances are accessible only via a factory.
The Factory uses an array to return only one -specific- instances of the class. This is a sort of Singelton
Of course the factory is a static get<Method>.
The method uses a Collection to store existing reference & is, up to now, appropriatelly synchronized to avoid returning double instances even when accessed by multiple threads.
My question is (finally):
To make sure the system behaves OK, I'd like to be able to deregister the class. Something doing the opposite of
<code>
Class.forName("MyClassName");
</code>

This would allow me to run the test multiple times w/o having to ensure the class is always called with different parameters from one test to another.
Tx,
Thomas,


22 years ago
i don't think there's any other way unless and otherwise you write your own classloaders. Even if you do that there will be multiple versions of a class in the jvm and am not sure how you w'd be able to handle that.
This leads to another question from my side.
I have used tomcat. Now we know if we change jsps while tomcat is still running, it picks up the recent version on the next access.
I have observed the various java files getting created every time we change the jsp which follows a certain naming convention.
fine a jsp -> compiled to ->servlet.
But does tomcat really reload the classfile or it picks up some other classfile since the jsp's java file name seems to be different from the earlier one.
prav.

22 years ago

i don't work on EJBs. but i have read about them...so i'll try.
Is it a publisher-subscriber kind of a model??
then the client needs to register with the server / probably the way event listeners work in Java.
Server can notify the client when a certain even occurs through callback.
In your case, i guess the message needs to go to a specific client, then you need to put some logic while registering the client. say ask the client to send some kind of an identification. store the client reference against that id in a hash. So when an even occurs you can look up the hash with id and send the notification to that client
I have not used JMS (java message service), you should be using that. I think this is what it is for.
it has the concept of provider and subscribers.
am a newbie to ejb world so my suggestion might not be very correct.
prav.

Originally posted by natasha malhotra:
While using a Java Client Application and an app-server EJB based server in a client-server environment, how do we notify the client of a new message (for ex: a mailing application) from the server instead of the client polling the server in a scheduled time frame?
Here the implementation should be using EJB on the app-server and not standard Java Class. Can this be done using an EJB?


22 years ago
this worked..
<xsl:template match="answer">
<input type = "radio" name="ans" value="{@sno}">
<xsl:value-of select="text()"/>
</input>
<br/>
</xsl:template>
thanks
prav

Originally posted by prav mane:
hi all,
as you can see here,
i need to evaluate the "value" attribute using the xsl:value-of statement. How do i tell the processor that the statement within the "" needs to evaluated.
it signals an error saying that an attribute value cannot have a "<".
<xsl:template match="answer">
<input type = "radio" name="ans" value="<xsl:value-of select="@sno"/>">
<xsl:value-of select="text()"/>
</input>
<br/>
</xsl:template>
thanks,
prav.


hi all,
as you can see here,
i need to evaluate the "value" attribute using the xsl:value-of statement. How do i tell the processor that the statement within the "" needs to evaluated.
it signals an error saying that an attribute value cannot have a "<".
<xsl:template match="answer">
<input type = "radio" name="ans" value="<xsl:value-of select="@sno"/>">
<xsl:value-of select="text()"/>
</input>
<br/>
</xsl:template>
thanks,
prav.

hi all,
I got the reply today from sun:
i had asked this before in the forum as well.
i had uploaded the assignment using the programmer exam id
Then i registered for the written test.
After taking the written test, i got another sheet confirming that i took the exam and that had another id (different from the programmer exam) on it.
Now they say i cannot upload with an id and take the test with a different id.
But i can't understand as to what i did wrong?
I had to upload before registering. So i used the prog exam id.
Then what is my fault if they assign me a different one after taking the written test??.
What was the case with rest of you guys??
prav

Originally posted by Gennady Shapiro:
I have found people at whotocontact@... not to be very responsive. Besides, in my experience, very often things get lost/confused/misplaced. So I call suned, then the things start moving fast.
40 days seems excessive, you should call them. You will find the 800 number at suned site.


hi all,
I just don't know what to do now.
I took the exam 40 days back, uploaded the source files 50 days back and have not heard from sun as yet.
I have sent numerous mails from the "faqs" section @ galton.
sent mails to diane hudlin and even "whotocontact@..". But no response at all.
I find it extremely difficult to digest that sun-ed guys could be so irresponsible.They took 400$ from me and i guess i atleast deserve a reply as to what went wrong??
prav.
congrats first for getting through the exam!
Now i need some advice!
I took the exam on 30th Oct. Have'nt heard from them as yet.
I have a feeling that there is something wrong with the way i uploaded the assignment.
I named the jar file as per the candidate id for the java2 "programmer" exam.
I got the confirmation as well that the upload went through properly.
Then i took the developer written test and got a different candidate id.
Now do they expect me to upload the jar file using this id as well???
programmer id = xyz // my jar file is names scjda-xyz.jar
developer test id = abc
I'm totally confused! please let me about your thoughts.
thanks,
prav.

Originally posted by Don Liu:
Nothing happened until today. Please be patient.
Don


thanks for the reassuring mail.