Aman Rustogi

Greenhorn
+ Follow
since May 11, 2001
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 Aman Rustogi

Smita i've the same functionality in my code. At a time i'm displaying 20 records resulting from search operation and i'm providing user with 'prev' and 'next' button as well as counter numbers which display next 20 records .. for eg. '1' displays 1-20 records ... '2' displays '21-40' records and so on.
I've have dis working in a servlet.
Do u think by providing u the sample code will solve ur purpose?
and besides i'm not storing the records fetched in sum collection object as the records fetched in my case can vary from anything between 10,000 - 15,000 records a time. So i'm a bit scared to use Collections Object as i'll need to store it in a Session to provide the above functionality.
19 years ago
u can trying flushing out the data from ur output stream after each iteration, to immediatly display the contents on the browser [using out.flush()].
Besides if u r using a Query String to update data, u could try using a stored procedure to do the same which comparatively is much faster than ur plain SQL string.
19 years ago
ur query would be sumthing like :
'select * from [table] where [column] >= 'mm/dd/yyyy' AND [column] <= 'mm/dd/yyyy'
code :
try {
[statement object] = [connectionObject].createStatement ( "[ur query]" );
[resultset object] = [statementObject].getResultset();
out.println ( "\n<table border='0' cellspacing='2' cellpadding='4' width='100%'>");
while [resultsetObject.next()]
{
out.println( "\n<tr height='25'>");
out.println ( "\n\t<td><a href=[ur link]>" + [resultsetObject].getString ([index]) + "</a></td>" );
out.println ( "\n</tr>")
}
}//end of try
catch ( SQLException e ) {
System.out.println ( e.getMessage() )
}
catch ( NullPointerException e ) {
System.out.println ( e.getMessage() )
}
finally {
[resultsetObject].close();
[statementObject].close();
}
I hope this shall help u out with ur requirement!
cheers
Aman
19 years ago
You can use the location replace method when changing the location. This replaces the current history location with the new location. However older browsers do not support this method, which is why it is required to test for the images object:
<script language="JavaScript"><!--
if (document.images)
location.replace('http://www.somewhere.com/apage.html');
else
location.href = 'apage.html';
//--></script>
or
Use href="javascript:location.replace('url'); to disable the browser back button
cheers
Aman

19 years ago
Arpit i feel the error is due to naming conflict.
Do all the text boxes where u enter the quantity have the same name? If that's the case, then the ERROR is bound to happen. U can avoid this by assigning different name's to each edit control and also test the object reference returned using 'eval()' in ur javascript function.
I hope this will resolve ur problem with my understanding.
cheers
Aman
19 years ago
I agree with Sunitra. A workaround solution would be to either set a timer [using javascript] to - ummm say sumthing 'round 2 mins. before again submitting the request/calling the servlet which calls the procedure. It would thus prevent the user from submitting the form till the time set expires.
cheers
19 years ago
Hi,
Thanking u'll again for all replies and queries. I'm still in development stage of the code to print files to the printer. The sooner I'm thr' with it, I shall publish it here! Currently i'm encountering an error while drawing the contents of file to be printed to the graphics object using drawString (). Calling this function, crashes the HotSpot Virtual Machine. Working 'round for a feasible solution, shall keep u updated. I guess the problem is using post-script printer drivers or with data-format sent to the printer - not sure yet!
Raghavendra, as u rightly said that i cannot access/print to clients printer using servlets, but i need this option in my intranet/interner site which will be accessible to just ONE SINGLE USER!
cheers
Aman
19 years ago
U would be required to have components such as Gatherer and Broker to enable Search option in ur website. The Gatherer is responsible for fetching Web-accessible resources from the Internet, parsing metadata from <META> tags embedded in HTML files into attribute-value pairs, encoding the metadata into SOIF (Summary Object Interchange Format), and sending the SOIF abstracts to a Repository managed by the Broker.
The Broker receives indexing information (as SOIFs) from one or more Gatherers, removes duplicate information, incrementally indexes the collected information (saving into the metadata repository), and provides a WWW query interface to it.
This just a initial implementation of implementing Search option, shall keep posting solutions to it as i progress with my development on it!
cheers
Aman
19 years ago
thx all!!
but the solution provided dusnt serve my purpose.
The javascript print option doesnt allow us to select the file to print and besides it isnt very reliable and also doesnt work in DOM!!
So I've designed my servlet in a manner in which it first displays a file dialog box enabling user to select the file and then submitting the data which will invoke another/same servlet, get an instance of PrinterJob, set the required attributes, have an inner class implementing Printable interface thus overriding Print(), draw the contents of the requested file to the Graphics object and then print the contents.
How does it sound? even i'm not sure of it, still working on it!
Thx all for ur support!
cheers
Aman
19 years ago
hi,
can I have the facility of printing documents from Servlets? I need to provide a PRINT option in HTMl pages generated from servlet?
How do I go about doing this? plz guide me
thnaking u in advance,
cheers
Aman
19 years ago
Hi !!
How do i make my Session object Serializable. so that it will then persist across ClassLoaders.
I'm using Apache Web Server and ApacheJserv as servlet engine. Now whenever I reload my class files the exsisting Session gets timed out which is not required in my case. I need to serialize the Session object so whenever the servlet object is destroyed and recreated with a new ClassLoader, it should retrieve it's state from the Session Object.
Thanking u in advance,
Aman
19 years ago
Hi,
Does relaoding of class files time out the existing Session when using Apache JServ in automatic mode?
If yes, is there any option I need to set to disable it?
Thanking u in advance,
Aman
19 years ago
Hi,
I need to hide controls in my HTML page.
I'm able to achieve this in IE browser using 'document.all.elemntID.style.visibility = hidden' for that control but not in Netscape 4.75 as NN doesnt support 'style' property.
How do I go about doing the same in Netscape 4.75??
Thanking u in advance
Aman
Thx Dave.
But i guess i cannot refresh the page as it contains hell lot of data.
Newayz thx for providing the tip !!
aman
Hi,
I need to delete a few elements from my combo box based on certain condition. I'm able to add contents into Combo Box at run-time using OPtion object but not able to delete.
How can I go about doing this ... plz guide me
Thanking u in advance,
Aman