File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Setting a value to a variable in jsp ..(value is passed by the servlet) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Setting a value to a variable in jsp ..(value is passed by the servlet)" Watch "Setting a value to a variable in jsp ..(value is passed by the servlet)" New topic
Author

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

avinash narasingam
Greenhorn

Joined: May 08, 2012
Posts: 6
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

Joined: Dec 18, 2011
Posts: 13

hi

try this
String value1=(String)request.getAttribute("firstName");


sailaja
avinash narasingam
Greenhorn

Joined: May 08, 2012
Posts: 6
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting a value to a variable in jsp ..(value is passed by the servlet)
 
Similar Threads
Lost Request Attributes
Unable to retrieve value in JSP
IBM 154 q&a passed: 66.7%
Passed
unable to pass data in same package