| Author |
JSP - cookie not processing as it should
|
tangara goh
Ranch Hand
Joined: Dec 27, 2009
Posts: 125
|
|
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.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
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.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
tangara goh
Ranch Hand
Joined: Dec 27, 2009
Posts: 125
|
|
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
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
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.
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6588
|
|
|
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
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
 |
|
|
subject: JSP - cookie not processing as it should
|
|
|