permaculture playing cards*
The moose likes IDEs, Version Control and other tools and the fly likes Problem in Implementing the example of headfirst servlets and jsp in netbeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Problem in Implementing the example of headfirst servlets and jsp in netbeans" Watch "Problem in Implementing the example of headfirst servlets and jsp in netbeans" New topic
Author

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

Rachit Kumar Saxena
Ranch Hand

Joined: Dec 24, 2011
Posts: 50
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]

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9327
    
110

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.

[My Blog] [JavaRanch Journal]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9327
    
110

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

Joined: Dec 24, 2011
Posts: 50
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

Joined: Jul 20, 2005
Posts: 9327
    
110

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

Joined: Dec 24, 2011
Posts: 50
This is the .zip file in the attachment containing the .java file i was talking about.
Palak Mathur
Ranch Hand

Joined: Jan 29, 2007
Posts: 313


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]


Palak Mathur | My Blog | TechJaunt | What is JavaRanch? | List of All FAQs
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in Implementing the example of headfirst servlets and jsp in netbeans
 
Similar Threads
Jrun problem
automatic refreshing
Returning a Value from a Post
Servlet Life Cycle Doubts
Change Timezone from GMT to EST, the best way to accomplish?