Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servletContext. setAttribute("", hashMap ) - Not compiling

 
Rashid Ali
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Folks
I am facing problem that the above method is not available in servlet under JBuilder 3 version.
I have included in Version Java1.3.2 and servlet.jar of Tomcat 4.0 in Jbuilder's liberary but it is still not getting response and not compiling it.
Please note that i am calling servletContext.setAttribute("", hashMap )in init() method of a servlet.
Even though when i compile with orion1.5.x it works fine and compiles successfully.
What the problem can be there, is there a version problem or something else.
Please respond to the above. thanks.
Best regards
Rashid Ali
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jbuilder is probably using an older version of the servlet API. setAttribute is available since version 2.2. It replaced the older method called putValue().
 
Rashid Ali
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your message Bosun.
You are right. JBuilder3 was using the JSDK old version when i deleted it and as already servlet.jar was in its liberary, it started to compile.
But now as i have deleted this JSDK old liberary and using servlet.jar, it is not running its own ServletServer.java file and not running its own server.
Any suggestion so that i can work with JBuilder's own server.
There might be a solution that i should to download a JSDK new version and put it in its liberary, will this work. Please suggest.
Kind regards
Rashid Ali
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic