This content has been marked as final.
Show 10 replies
-
1. Re: URL parameter
wise_guybg Aug 23, 2007 8:22 AM (in response to mpulse)To have the parameter injected in a field inside your component you can do:
@RequestParameter String id;
-
2. Re: URL parameter
mpulse Aug 23, 2007 8:45 AM (in response to mpulse)I also try
String id = (String) FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id")
But I just get a NULL value :s -
3. Re: URL parameter
wise_guybg Aug 23, 2007 8:58 AM (in response to mpulse)Here is an example of the use of RequestParameter
import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.RequestParameter; @Name("detail") public class Detail { @RequestParameter Long entryId; public Long getEntryId() { return entryId; } public void setEntryId(Long entryId) { this.entryId = entryId; } public Entry getEntry() { return new Entry(entryId); } }
-
4. Re: URL parameter
wise_guybg Aug 23, 2007 9:01 AM (in response to mpulse)In my Seam 2.0.0.BETA1 there is also a class Parameters (component name: org.jboss.seam.web.parameters)
It has a getRequestParameters() method. -
5. Re: URL parameter
mpulse Aug 23, 2007 9:14 AM (in response to mpulse)I don't understand :(
first : i use<s:link view="/smsInfo.xhtml" value="info"/>
for the link how add a parameter ? it must be visible in the url
with that link i have == > smsInfo.seam?cid=43
So how add id => #{msg.id}
Second : if a want that, it's for share page link so if the paramater is in the session in java :/ i don't see how it can work :/
the page will load a message by its ID. -
6. Re: URL parameter
alexg79 Aug 23, 2007 9:18 AM (in response to mpulse)So how add id => #{msg.id}
<s:link view="/smsInfo.xhtml" value="info"> <f:param name="id" value="#{msg.id}"/> </s:link>
-
7. Re: URL parameter
mpulse Aug 23, 2007 10:25 AM (in response to mpulse)thanks I arrive to pass id in parameter.
But i don't arrive to get it in java, always null value :( -
8. Re: URL parameter
mpulse Aug 23, 2007 11:39 AM (in response to mpulse)Parameters p = new Parameters(); Map<String,String[]> map = p.getRequestParameters();
send me null value -
9. Re: URL parameter
alexg79 Aug 23, 2007 8:06 PM (in response to mpulse)thanks I arrive to pass id in parameter.
But i don't arrive to get it in java, always null value :(
You probably meant to use some other word here than "arrive", but I can't figure it out.
Anyway, you need this in the component you use on the destination page:... @RequestParameter private Integer id; ...
Use whatever type is appropriate in place of "Integer". Worked for me.
Alternatively, try reading up on page parameters in the Seam documentation. -
10. Re: URL parameter
mpulse Aug 24, 2007 2:57 AM (in response to mpulse)Sorry for my bad english.
I add to page.xml =>
<page view-id="/smsInfo.xhtml" action="#{MyAction}"/>
And now it work with @RequestParameter
Thanks a lot.