• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in Implementing the example of headfirst servlets and jsp in netbeans

 
Rachit Kumar Saxena
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying an example of the example of above book on page 190(example is given as newservlet.jpeg(please open it with any text editor as it is not a valid .jpeg file)).The first time when the servlet is run though the output is 22 and 42,but as the context attributes arent thread safe,the second time when I run the servlet the result should have been affected(as pointed out in the book),but i see the same output.Why do i see the same output each time?
newservlet.jpeg
[Thumbnail for newservlet.jpeg]
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rachit Kumar Saxena wrote:(example is given as newservlet.jpeg(please open it with any text editor as it is not a valid .jpeg file)).

What is it then? A txt file? If the contents are too large then zip it attach the .zip. If the contents aren't that much, then just post those inline within your post.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for your question, it doesn't look like it has anything to do with IDE. Once you post more details, I or some other moderator will move this to the Servlet forum.
 
Rachit Kumar Saxena
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,it is a .txt file but labelled as .jpeg FILE.As for the question,the details are:
As each request is handled in a separate thread,the output should have been affected,the second time the example is run,but the output remains same in netbeans.Why?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rachit Kumar Saxena wrote:Yes,it is a .txt file but labelled as .jpeg FILE.As for the question,the details are:
As each request is handled in a separate thread,the output should have been affected,the second time the example is run,but the output remains same in netbeans.Why?

Like I said, you have to fix that attachment (attach an .zip containing that txt file instead or post the contents of the txt file). Without that information, I've no clue what output and what program you are talking about.
 
Rachit Kumar Saxena
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the .zip file in the attachment containing the .java file i was talking about.
 
Palak Mathur
Ranch Hand
Posts: 342
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rachit,

You first said that it is a txt file uploaded as jpeg. Now you are saying it is a zip file. Better copy and paste your code here and use Code tags.

[Code][/Code]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic