Marcus, What datatype does getLocal() return?
I would likely write: SetLocalForm myForm = (SetLocalForm)form first and then: String localString = myForm.getLocal(); or: String localString = myForm.getLocal().toString(); It may not execute and differently, but it keeps the cast separate and clear. HTH Brian ----- Original Message ----- From: "Marcus Biel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 13, 2002 6:25 AM Subject: OT: Re: user manually changing local > ARG! What the hell is wrong here ??? > import java.util.Locale; > import java.lang.*; > import java.sql.*; > import javax.servlet.http.*; > import org.apache.struts.action.*; > > public class SetLocalAction extends Action { > public ActionForward perform(ActionMapping mapping, > ActionForm form, HttpServletRequest request, HttpServletResponse > response){ > > String localString = (SetLocalForm)form.getLocal(); > > Locale local = new java.util.Local(localString, localString); > request.getSession().setAttribute(Action.LOCALE_KEY, local); > return mapping.findForward("setLocalActionDone"); > } > } > > Got a SetLocalForm.class that has got the method getLocal() so it should > be working. > > But when I try to compile the Action, I get: > > SetLocalAction.java:12: cannot resolve symbol > symbol : class SetLocalForm > location: class SetLocalAction > String localString = (SetLocalForm)form.getLocal(); > ^ > SetLocalAction.java:12: cannot resolve symbol > symbol : method getLocal () > location: class org.apache.struts.action.ActionForm > String localString = (SetLocalForm)form.getLocal(); > ^ > SetLocalAction.java:14: cannot resolve symbol > symbol : class Local > location: package util > Locale local = new java.util.Local(localString, localString); > ^ > 3 errors > > > Damn! Thats frustrating! > > marcus > > -- > To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org> > For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org> > > -- To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>