Click to See Complete Forum and Search --> : change servlet without user input


rychi
03-09-2007, 01:14 AM
Hi,
I was wondering if there was any way to navigate automatically to a servlet without having to click a button. User currently clicks on the html button to go to the next page. Which is a different servlet. I want to remove the button clcking step so it shoiws the next page without user input. I am using this html button to
out.println("<a href='/servlets/Administration?next'><img src='/images/standards/ico_next.gif' alt='Choose Type' align='absmiddle' border='0'></a>");

Thanks

jasonahoule
03-09-2007, 04:55 AM
Are you talking about auto-forwarding or displaying the page for a certain amount of time, then forwarding?

javula
03-09-2007, 05:55 AM
if there are no data entry you may want to get from the page you don't have to use a servlet. But if there is some kind of data manipulation to be done, i don't think you can do it without a submit button.

javula
03-09-2007, 06:26 AM
One of the most common ways to invoke a servlet from an HTML page is to provide a link to it from a button on a form. You can also invoke a servlet by embedding a link to it in an HMTL page, or even by typing its pathname into the Address bar of a browser. Still another way to invoke a servlet is to call it from another servlet -- but we won't go any further into that option in this article.

http://java.sun.com/products/servlet/articles/tutorial/

ok.. i found something else for the user not to click on a submit button, but having the form itself do that.

<BODY onLoad="document.forms[0].submit();">

rychi
03-11-2007, 08:07 PM
Thanks for the help.
<BODY onLoad="document.forms[0].submit();"> this code worked perfectly.
Cheers.