Ravi,

This is my HTML code

<HTML>
<HEAD>
<TITLE> Simple JSP Program </TITLE>
</HEAD>
<BODY>
<P>How Many Times </P>

<FORM METHOD="GET" ACTION="SimpleJSP.jsp">
<input type = "TEXT" size="4" name="numtimes">
<input type = "SUBMIT" VALUE="SUBMIT Query">
</FORM>

</BODY>
</HTML>

& this is my jsp code.

<%@ page language="java" %>
<HTML>
<HEAD>
<TITLE> Simple JSP Program </TITLE>
</HEAD>
<BODY>
<P>
<% int numberoftimes = Integer.parseInt(request.getParameter("numtimes"));
        for(int i = 0;i<numberoftimes; i++){
%>
<%= i %>
        Hello World!<BR>
<%
}
%>

</P>
</BODY>
</HTML>

If I don't give ACTION="http://localhost:8100/SimpleJSP.jsp"> in my html it
doesn't execute the
for loop but it invokes the jsp file as it is displaying "Hello World!"
once.
Could you tell me why is this happenning?

Thanks in advance,

Rajeev


-----Original Message-----
From: ravi [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 11:00 AM
To: [EMAIL PROTECTED]
Subject: Re: Kindly Help


rajeev,
 if  u put ur code it will  help us to find out where u went wrong,
i feel the information u gave is just not adequate to solve ur problem.

cheers,
ravi

Rajeev Sharma wrote:

> Hi All,
>
> I am calling a jsp from a HTML file & on submit the following code will be
>
> invoked in the jsp.
>
> <FORM METHOD="GET" ACTION="SimpleJSP.jsp">
>
> There is a for loop in the jsp but it is getting invoked only once.
>
> But if I change the html to <FORM METHOD="GET"
>
> ACTION="http://localhost:8100/SimpleJSP.jsp">
>
> the for loop is getting executed.
>
> Could anyone tell me the reason?
>
> Thanks in advance,
>
> Rajeev
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to