Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Urgen

 
Sribala Buckstube
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 11865
194
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
     
    David Newton
    Author
    Rancher
    Posts: 12617
    IntelliJ IDE Ruby
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Pie
    Posts: 64712
    86
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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).

     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Pie
    Posts: 64712
    86
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Also, you'll have to tell us what "no working" means. We can't guess. Please read ItDoesntWorkIsUseless for details.
     
    Sribala Buckstube
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 12617
    IntelliJ IDE Ruby
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic