• 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

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

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the .zip file in the attachment containing the .java file i was talking about.
 
Ranch Hand
Posts: 343
Mac OS X Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
reply
    Bookmark Topic Watch Topic
  • New Topic