• 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 - cookie not processing as it should

 
Ranch Hand
Posts: 1021
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've been trying to get the jsp to display a table to show the name enter from a form.

However, it doesn't show the table which will display the Name, Value and Comments.

Hope someone can advise me where have I gone wrong with my codes. Thanks.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Firstly, why are you using out.print to emit HTML code? That's why we use JSP in the first place... so that we can just use template text for HTML.

Secondly, you are not generating valid HTML. Do a View Source in the browser and look at the HTML that is being sent to the browser. You'll see that it's a mess.
 
tangara goh
Ranch Hand
Posts: 1021
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. I will remove the html portion.

But, please advise the jsp portion how to make it correct. Sorry this is my first attempt in a jsp so not very sure.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not clear that there's anything wrong with your JSP at all... except for the fact that you are putting Java code in a JSP -- a practice that has been frowned upon for over 8 years now.

If your JSP is not creating valid HTML, the display will not be correct. Making sure that valid HTML is being generated is the first step to even determining if there are any other problems.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cookie c is never assigned a value. And ++ on what Bear said. Why is java+jsp code together like that ? Separate your view components and place them in your JSP
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic