Put parameters into url -->Howto?

Hi all!

How can I post some parameters to get an url something like that

http://localhost:8080/application?user=test

So how can I get the parameter user into my url?

Can I just use the f:param Tag?

And who do I retrieve the information on the next page?

thx for help!

[317 byte] By [Semmerlea] at [2007-10-2 12:08:50]
# 1

Wow, 1 duke dollar, geez big spender huh? :-)

Yes, f:param will work. Nest this tag inside commandLink.

Their are a couple of ways to get the paramter out of the request but the most elegant is using the "param" implicit EL varialble and the managed-property element of the managed bean configuration.

Something like:

<managed-bean>

<managed-bean-name>yourBean</managed-bean-name>

<managed-bean-class>foo.YourClass</managed-bean-class>

<managed-bean-scope>request</managed-bean-scope>

<managed-property>

<property-name>yourBeanProperty</property-name>

<value>#{param.yourParamNamey}</value>

</managed-property>

</managed-bean>

Silmendila at 2007-7-13 8:45:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

First of all, thanks for your reply (Here is a hard-earned ;-) nuke dollar)

But I still have some questions:

Can I use the f:param inside a commandButton?

And is the f:param enough to get a url like

http://localhost:8080/application?user=test

So do I only have to set:

<f:param name="user" value="test"/> ?

Regards,

Andy

Semmerlea at 2007-7-13 8:45:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
You can simply use ...FacesContext.getExternalContext().getRequestParameterMap().put("key","value")....Can you call this in your action menthod before navigating to the application.
mandarkulkarnia at 2007-7-13 8:45:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
But FacesContext.getExternalContext().getRequestParameterMap().put("key","value")....doesn't give me a url like this: http://localhost:8080/application?user=testor have I done something wrong?
Semmerlea at 2007-7-13 8:45:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
I haven't been able to get <f:param> to work with commandButtons. It works okay with commandLinks, though.
reichewa at 2007-7-13 8:45:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...