Re: XMLForm: how to retrieve URL parameter?
You can also see the source of the request generator. It's almost the same thinglook the setup method. Lionel At 23:15 31/03/2003 +0200, you wrote: Sure: public Map act (Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters params) throws java.lang.Exception { Map resultMap = super.act(redirector, resolver, objectModel, source, params); Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT); //I think you can also write the above line this way: //Request request = ObjectModelHelper.getRequest(objectModel); String the_parameter = request.getParameter("the_parameter"); ... I do not know if easier ways exist but this worked for me. Hope it helps. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 31, 2003 2:07 PM Subject: RE: XMLForm: how to retrieve URL parameter? > Hi again, > > Could you give an example of your code? > > Thanks > Sylvain > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XMLForm: how to retrieve URL parameter?
Sure: public Map act (Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters params) throws java.lang.Exception { Map resultMap = super.act(redirector, resolver, objectModel, source, params); Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT); //I think you can also write the above line this way: //Request request = ObjectModelHelper.getRequest(objectModel); String the_parameter = request.getParameter("the_parameter"); ... I do not know if easier ways exist but this worked for me. Hope it helps. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 31, 2003 2:07 PM Subject: RE: XMLForm: how to retrieve URL parameter? > Hi again, > > Could you give an example of your code? > > Thanks > Sylvain > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XMLForm: how to retrieve URL parameter?
Hi again, Could you give an example of your code? Thanks Sylvain -Message d'origine- De: Josema Alonso [mailto:[EMAIL PROTECTED] Date: lundi, 31. mars 2003 13:58 À: [EMAIL PROTECTED] Objet: RE: XMLForm: how to retrieve URL parameter? Yes, if you go this way. You can call its parent act method if needed at the beginning anyway. When I used that code, my first line in the action was: Map resultMap = super.act(redirector, resolver, objectModel, source, params); Anyway, maybe going the other way suggested in this thread would be easier. Best. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: lunes, 31 de marzo de 2003 13:18 Para: [EMAIL PROTECTED] Asunto: RE: XMLForm: how to retrieve URL parameter? Hi Josema, Do I need to override the act() method in the Action? Regards Sylvain -Message d'origine- De: Josema Alonso [mailto:[EMAIL PROTECTED] Date: lundi, 31. mars 2003 11:58 À: [EMAIL PROTECTED] Objet: RE: XMLForm: how to retrieve URL parameter? If i remember correctly, the Request is held in the objectModel, so in your act method you can do: Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT); And get the desired paramater from there. Best. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: lunes, 31 de marzo de 2003 9:38 Para: [EMAIL PROTECTED] Asunto: XMLForm: how to retrieve URL parameter? Hello, I'm using an URL like below to access to a XMLForm application: http://myServer:8080/myApp?id=2500 I need to retrieve this parameter (id) from within the XMLForm Action class. The purpose is to populate the Bean with an object (id=2500) coming from the database. What is the best solution to retrieve the URL? Thanks Sylvain (T) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XMLForm: how to retrieve URL parameter?
Yes, if you go this way. You can call its parent act method if needed at the beginning anyway. When I used that code, my first line in the action was: Map resultMap = super.act(redirector, resolver, objectModel, source, params); Anyway, maybe going the other way suggested in this thread would be easier. Best. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: lunes, 31 de marzo de 2003 13:18 Para: [EMAIL PROTECTED] Asunto: RE: XMLForm: how to retrieve URL parameter? Hi Josema, Do I need to override the act() method in the Action? Regards Sylvain -Message d'origine- De: Josema Alonso [mailto:[EMAIL PROTECTED] Date: lundi, 31. mars 2003 11:58 À: [EMAIL PROTECTED] Objet: RE: XMLForm: how to retrieve URL parameter? If i remember correctly, the Request is held in the objectModel, so in your act method you can do: Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT); And get the desired paramater from there. Best. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: lunes, 31 de marzo de 2003 9:38 Para: [EMAIL PROTECTED] Asunto: XMLForm: how to retrieve URL parameter? Hello, I'm using an URL like below to access to a XMLForm application: http://myServer:8080/myApp?id=2500 I need to retrieve this parameter (id) from within the XMLForm Action class. The purpose is to populate the Bean with an object (id=2500) coming from the database. What is the best solution to retrieve the URL? Thanks Sylvain (T) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XMLForm: how to retrieve URL parameter?
Hi Josema, Do I need to override the act() method in the Action? Regards Sylvain -Message d'origine- De: Josema Alonso [mailto:[EMAIL PROTECTED] Date: lundi, 31. mars 2003 11:58 À: [EMAIL PROTECTED] Objet: RE: XMLForm: how to retrieve URL parameter? If i remember correctly, the Request is held in the objectModel, so in your act method you can do: Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT); And get the desired paramater from there. Best. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: lunes, 31 de marzo de 2003 9:38 Para: [EMAIL PROTECTED] Asunto: XMLForm: how to retrieve URL parameter? Hello, I'm using an URL like below to access to a XMLForm application: http://myServer:8080/myApp?id=2500 I need to retrieve this parameter (id) from within the XMLForm Action class. The purpose is to populate the Bean with an object (id=2500) coming from the database. What is the best solution to retrieve the URL? Thanks Sylvain (T) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XMLForm: how to retrieve URL parameter?
If i remember correctly, the Request is held in the objectModel, so in your act method you can do: Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT); And get the desired paramater from there. Best. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: lunes, 31 de marzo de 2003 9:38 Para: [EMAIL PROTECTED] Asunto: XMLForm: how to retrieve URL parameter? Hello, I'm using an URL like below to access to a XMLForm application: http://myServer:8080/myApp?id=2500 I need to retrieve this parameter (id) from within the XMLForm Action class. The purpose is to populate the Bean with an object (id=2500) coming from the database. What is the best solution to retrieve the URL? Thanks Sylvain (T) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XMLForm: how to retrieve URL parameter?
Title: RE: XMLForm: how to retrieve URL parameter? Hi, Try putting code like this in the prepare() method: Request request = getRequest(); String stringId = request.getParameter("id"); Keith. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 31 March 2003 08:38 To: [EMAIL PROTECTED] Subject: XMLForm: how to retrieve URL parameter? Hello, I'm using an URL like below to access to a XMLForm application: http://myServer:8080/myApp?id=2500 I need to retrieve this parameter (id) from within the XMLForm Action class. The purpose is to populate the Bean with an object (id=2500) coming from the database. What is the best solution to retrieve the URL? Thanks Sylvain (T) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This electronic mail system is used for information purposes and is not intended to form any legal contract or binding agreement. The content is confidential and may be legally privileged. Access by anyone other than the addressee(s) is unauthorised and any disclosure, copying, distribution or any other action taken in reliance on it is prohibited and maybe unlawful All incoming and outgoing e-mail communications and attachments are scanned automatically by software designed to detect and remove any material containing viruses or other unauthorised content. While we undertake best endeavours to ensure that this content checking software is up to date, recipients should take steps to assure themselves that e-mails received are secure. ***