hello isabel. it think this is not possible out-of-the box. you can inject request attributes, but not request parameters - available injectors: [1]
but it would by fairly easy to write your own custom injector [2] for this usecase and register it via OSGi. stefan [1] http://sling.apache.org/documentation/bundles/models.html#available-injectors [2] http://sling.apache.org/documentation/bundles/models.html#custom-injectors >-----Original Message----- >From: Isabel Martínez [mailto:imarti...@seidor.es] >Sent: Thursday, November 27, 2014 12:09 PM >To: users@sling.apache.org >Subject: Sling Models to inject RequestParameter > >Hi, >I want to develop a Model adaptable form SlingHttpServletRequest >“@Model(adaptables={SlingHttpServletRequest.class})”, and inject a parameter >from the slingRequest (RequestParameter getRequestParameter(java.lang.String >name) to a java parameter “@Inject RequestParameter requestParameter;” but I >haven’t found the correct way to do it. This parameter it’s send via Ajax’s >call with a GET method. > >Can somebody help me? It’s possible to get this type of parameters in a sling >model or I have to get the parameter from de request directly. > >Regards, > >Isabel Martínez >http://www.seidor.es > > > > > > >Tel: >+34 902 995 374 > >Pujades, 350 2ª >Edificio Inbisa 22@ >08019 Barcelona >España > > >Antes de imprimir este mensaje, asegúrese de que sea imprescindible. Proteger >el medio ambiente está a nuestro alcance. > > > > > >La información que contiene este correo electrónico es confidencial y compete >exclusivamente al destinatario. Si Vd ha recibido esta comunicación por error, >por favor, notifíquelo inmediatamente al remitente y borre el mensaje junto >con sus ficheros anexos sin leerlo, copiarlo, grabarlo, distribuirlo o >divulgarlo o hacer cualquier otro uso de la información sin el consentimiento >de la empresa. El correo electrónico vía Internet no permite asegurar la >confidencialidad o correcta recepción de los mensajes, por lo que la Empresa >no asume responsabilidad alguna por los daños causados. >The information contained in this communication is confidential, may be >privileged and is intended for the exclusive use of the above named addressee. >If you receive this communication in error, please notify the sender >immediately and delete it, and all its attached documents. If you are not the >intended recipient, you are expressly prohibited from reading, copying, >distributing, disseminating or, in any other way, using any of the information >without the company consent. Please note that Internet e-mail guarantees >neither the confidentiality nor the proper receipt of the message sent, so >that the Company shall not be liable for any damages caused.