RE: XMLForm: how to retrieve URL parameter?

2003-03-31 Thread Josema Alonso
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?

2003-03-31 Thread Sylvain.Thevoz
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?

2003-03-31 Thread Josema Alonso
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?

2003-03-31 Thread Josema Alonso
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]