Win a copy of The Java Performance Companion this week in the Performance 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic