I'm a fan of the Struts ActionForm. If you wanted to populate an object with query parameters, you might think about creating a managed bean and use the setter injection stuff.
<managed-bean>
<managed-bean-name>formBean</managed-bean-name>
<managed-bean-class>xxx.FormBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>username</property-name>
<value>#{param.username}</value>
</managed-property>
</managed-bean>
You could use a helper method to get to the "formBean". Struts Shale
ViewController would be a perfect fit for this pattern. It has a helper method
called getBean();
public void prerender() {
FormBean queryParams = (FormBean) getBean("formBean");
String userName = queryParams.getUserName();
}
Gary
--- Begin Message ---On 8/26/05, Patel, Hitesh (Exchange) <[EMAIL PROTECTED]> wrote:You can pass the parameter as you have done and get the value of the parameter as follows
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("empID");
I would guess this common to have to use? I would think it would be, and find it a bit odd that there isn't a more convenient way to get the params. Granted I can probably make a helper method to do the above.
I know that in many of my apps I have cases where you'll click on a link or button in order to get to a different populated screen based on an id or some other var(s). For example in one app there are a lot of page that on the top of the page it displays the user you are looking at and provides a few convenience buttons next to the name for viewing 'summary' 'user logs' etc - which are just links that execute actions and the appropriate information is pulled back based on some params passed through the link.
--
Rick
--- End Message ---

