• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp problems, only one part of code executes

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator




okay the code is supposed to make a table and display student names from the student table, and then afterwards have some text boxes to enter the student name you want to edit, then the new student info (new name and new id number)... well when I execute it, it will show a form for asking wwhat data to update, but it completely skips the first part of the code that sets a table to display the list of students...... funny thing is, when I delete the part about asking for student update info, it will show the list of students... why will it only do the second part of the code when I have them both? how do I make it both show all students in the database, AND ask for student info to update at the bottom ?
thanks guys I appreciat it
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rogelio Trist�n,
Whenever you post more than a line or two of code, you should wrap them in the UBB Code tags (there is a button to generate them on the reply screen). These tags will preserve your code's indenting -- making it easier for others to read. This, of course, makes it more likely that someone will actually read it and thus, makes it more likely that you will get help.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what do you mean? I did put it in CODE tags...

anyone know the answer?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

what do you mean? I did put it in CODE tags...



You did.
I see them there now.
Not sure how I missed them.
I apologize.. profusely

There are a lot of little things that could be giving you trouble
Such as improper xml syntax:


and submit tags that are not within the HTML form tags:


Also, within your form, I don't see any input fields at all so I'm not sure how they could be showing:

and within that form there is a table without any TD or TR tags.


There may be another small syntax error that is preventing your table from rendering. Try looking at the HTML source to see if it is being printed to the page but not rendered due to an HTML bug.

The above points are, for the most part, nitpicking.
There is one very serious problem with this code that I want to point out:

Whenever you declare variables like this:

you're creating what are called instance variables.
Variables declared this way are not thread-safe.
They are shared by all requests being processed by your JSP and will lead to major concurrency issues if not fixed.
Unless you have a pressing need to do this and know exactly what you're doing, you should avoid it.
Declare all of your variables inside the JSPs service method by not using the <%! operator.
[ May 14, 2005: Message edited by: Ben Souther ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic