File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Type safety: Unchecked cast from Object to List<String> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic
Author

Type safety: Unchecked cast from Object to List<String>

jazy smith
Ranch Hand

Joined: Nov 18, 2009
Posts: 101
Hi all,

I have a jsp scriplet where i wrote this code

List<String> user = (List<String>)session.getAttribute("username") ;

but it says " Type safety: Unchecked cast from Object to List<String>" error. Any idea to resolve it ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61082
    
  66

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please read this for more information.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Type safety: Unchecked cast from Object to List<String>