--- Mansour <[EMAIL PROTECTED]> wrote: > I am trying to extract an int in the prepare method. > I am not able to cast it. This is an example of what > I am trying to do: > > Map parameters = > ActionContext.getContext().getParameters(); > Integer task_id = (Integer) > parameters.get("task.id"); > > I wanna try to avoid using Type conversion.
Um, why? > This didn't work either: > > int task_id = Integer.parseInt( > parameters.get("task.id").toString()) ; > > Do I have to use type conversion even for primitive > types? > > Any idea? Yes, look up what the parameters map actually contains. Normally when reporting an error like this you'd show the typecast exception you're getting, which should provide a clue as to why it isn't working, as an array of a type can't be converted to a single instance of a type. There are quicker ways of finding answers to these questions than posting to the group! d. ____________________________________________________________________________________ Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545433 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]