Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting a value to a variable in jsp ..(value is passed by the servlet)

 
avinash narasingam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone
i have a value which is setted in the servlet(request.setAttribute("firstName", details.getFirstName());using dispatcher i passed the value to the jsp
But now how to assign that value firstname to a variable in jsp?
i am using String value1=request.getAttribute("firstName"); in my jsp
but i am getting an error saying "Type mismatch: cannot convert from Object to String"
can anyone help me
thanks
 
sailaja koney
Greenhorn
Posts: 13
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

try this
String value1=(String)request.getAttribute("firstName");
 
avinash narasingam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yupp,,thank u..problem solved..
does anyone know how to close the window automatically without having a prompt or alert box .
if we try window.close() a alert box is displayed asking yes or no to close the window
i dont want the confirmation message.
but window should be closed
 
Do not set lab on fire. Or this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!