|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: How to get request params easily?Andrey Siver wrote:
> > > Dear list members, > > I'm newby in Woodstock framework... > > Is there any simple way how to set the request params of RequestBean1 > object from the request? > > This way is too long and awful: > > Map params = getExternalContext().getRequestParameterMap(); > > if (params.get("param1") != null) > > getRequestBean1().setParam1(Double.parseDouble(params.get("param1").toString())); > > > Thanks in advance, > Regards, > > -Andrey > If so, you can leverage managed properties to set the value like so: (this is a child element of managed-bean) <managed-property> <property-name>param1</property-name> <value>#{param.param1}</value> </managed-property> When RequestBean1 is instantiated, it will pass the value of the request parameter 'param1' to your setter, setParam1() for you. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
RE: Re: How to get request params easily?Netbeans had some tutorials on this and it makes development almost
trivial. I am still new at all of this yet I built an entire web application just using Netbeans, now if I can only figure out why listbox render with different widths in IE vs. Firefox.... Check out: http://www.netbeans.org/kb/trails/web.html Or specifically: http://www.netbeans.org/kb/60/web/scopes.html Thanks, Rob -----Original Message----- From: Ryan.Lubke@... [mailto:Ryan.Lubke@...] Sent: Wednesday, June 18, 2008 9:44 AM To: users@... Subject: Re: How to get request params easily? Andrey Siver wrote: > > > Dear list members, > > I'm newby in Woodstock framework... > > Is there any simple way how to set the request params of RequestBean1 > object from the request? > > This way is too long and awful: > > Map params = getExternalContext().getRequestParameterMap(); > > if (params.get("param1") != null) > > ring())); > > > Thanks in advance, > Regards, > > -Andrey > I'm guessing RequestBean1 is a JSF managed bean? If so, you can leverage managed properties to set the value like so: (this is a child element of managed-bean) <managed-property> <property-name>param1</property-name> <value>#{param.param1}</value> </managed-property> When RequestBean1 is instantiated, it will pass the value of the request parameter 'param1' to your setter, setParam1() for you. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: How to get request params easily?Dear Ryan,
Possibly I formulated the question not very good :). So: is it possible to get request param (sending to JSP page) easily then: >>> Map params = getExternalContext().getRequest
ParameterMap(); Double param1; if (params.get("param1") != null) param1 = (Double.parseDouble(params.get("param1").toString())); <<<It would be great if every bean field in RequestBean1 set up automatically from the request. So it would be enough just right >>>Double param1 = RequestBean1.getParam1(); <<< (and requestBean1.param1 should be set somewhere during initialization). Thanks, -Andrey
2008/6/18 Ryan Lubke <Ryan.Lubke@...>: I'm guessing RequestBean1 is a JSF managed bean? |
|
|
RE: How to get request params easily?Hi
Andrey,
I hope
this prerender method from a JSF page containing a Woodstock TextArea component
will help:
public
void prerender() {
HttpServletRequest request = (HttpServletRequest) this.getExternalContext().getRequest(); Enumeration headerIter = request.getHeaderNames(); while(headerIter.hasMoreElements()) { String headername = (String) headerIter.nextElement(); String areaText = null; if(this.textArea1.getText() != null) { areaText = this.textArea1.getText().toString(); } areaText += headername + ": " + request.getHeader(headername) + '\n'; this.textArea1.setText(areaText); } String areaText =
this.textArea1.getText().toString();
areaText += request.getLocalName() + '\n' + request.getLocalAddr() + '\n'; this.textArea1.setText(areaText); String clientAddr= "Client IP: " + request.getRemoteAddr(); String clientPc = "Client host: " + request.getRemoteHost(); areaText += clientAddr + '\n' + clientPc; this.textArea1.setText(areaText); } Oddvard
|
|
|
Get data form scheduler componentDear list members, im newby in WoodsTock framework... I need use the new scheduler componet.. i saw the examle on the web and the tags document but i dont know how use schedulerBean class for extract data of this component. For example (see the attachment) I put a button and a statictext in the window with the scheduler component and In the button action I write staticText1.setText(scheduler1.getvalue().toString()); So when I click the button I can see an entire text with the data but not separate. Please somebody tell me how can I use schedulerBean, do I call from applicationBean? With getters and setters? If anybody have an example please send me it. Regards
|
| Free Forum Powered by Nabble | Forum Help |