aspose file tools*
The moose likes Servlets and the fly likes Urgen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Urgen" Watch "Urgen" New topic
Author

Urgen

Sribala Buckstube
Greenhorn

Joined: Sep 26, 2010
Posts: 3
my code.

<%
for (i==1; i<3 || I>2; i++){
read(mypage.html);
i++;
System.out.println("mypage.html = " + html);
}
%>

this is urgent. I change jsp to txt and it still no work.

pleas to help
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11509
    
  95

Please don't take this the wrong way, but I think you need to start with basic Java before you try JSPs.

In your for loop, you start by comparing i to 1. Why? This does nothing for you - normally the very first part of a for loop is used for initializing a variable.

[Side note: your provided code does not ever declare what i is - I assume it is meant to be an integer, but the provided code does not indicate that]

To determine when to stop looping, you specify that the code is to continue if:
  • i is less than 3, or
  • I is greater than 2
  • Is I a typo - should it be i? If so, when do you think that i will be neither less than 3 or greater than 2?

    The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
    David Newton
    Author
    Rancher

    Joined: Sep 29, 2008
    Posts: 12617

    Also, please UseAMeaningfulSubjectLine when posting. Explaining your question or remark briefly on the subject line allows us to know what we are getting into, and if we will be able to help.

    (And EaseUp, assuming you meant to say "urgent".)
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61654
        
      67

    If you are just starting out with JSP, you should start off on the right foot and learn to never put Java code in a JSP. You'd be better served to learn how to write modern JSPs using the EL (Expression Language) and the JSTL (JSP Standard Tag Library).


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61654
        
      67

    Also, you'll have to tell us what "no working" means. We can't guess. Please read ItDoesntWorkIsUseless for details.
    Sribala Buckstube
    Greenhorn

    Joined: Sep 26, 2010
    Posts: 3
    Thank you Andrew for kind response I try java first.


    Bibult. I try tot run using htp server and I am met with Not Found
    The requested URL /sriva.htm was not found on this server.
    I try to follow "ItDoesntWorkIsUsless"




    Maybe to write servlet.
    David Newton
    Author
    Rancher

    Joined: Sep 29, 2008
    Posts: 12617

    Following ItDoesntWorkIsUseless would entail providing a bit more information, like the web.xml you've used to configure the page, the file/directory layout you've deployed, and so on.
     
    Don't get me started about those stupid light bulbs.
     
    subject: Urgen