Users - How to get Form data( request parameters) in a java service

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Users - How to get Form data( request parameters) in a java service

rams-2
Hi All,
I want to write a service in OfBiz using java .
It should check the username received from the form and check with password in
the database. If he is a valid user it should greet him with his name.like
"Hello"..username;
How can I do this.
I want to write my own code.
How can I get the user data submitted from the form in an ofbiz java service.
............
<field name="username" title="UserName"><text/></filed>
.............
............
public Map checkUserLogin(DispatchContext ctx,Map context){

       String username=(String) dctx.getAttribute("username");
}

I tried the above code..
But it is giving null for the username.
How can I do this.
How can get the data from the DB in a java service?
Please answer these ..It is very urgent.
thanks and regards
RamReddy



This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient or received it in error, please contact the sender by reply e-mail and destroy all copies of the original message. Please do not copy it for any purpose or disclose its contents.

Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights Reserved
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - How to get Form data( request parameters) in a java service

David E. Jones

Get it from the context Map, not the DispatchContext object.

It looks like you're just getting started with this, so I _highly_ recommend looking at examples of existing Java services in OFBiz. You'll probably learn a lot faster than randomly poking around.

-David


rams wrote:

> Hi All,
> I want to write a service in OfBiz using java .
> It should check the username received from the form and check with password in
> the database. If he is a valid user it should greet him with his name.like
> "Hello"..username;
> How can I do this.
> I want to write my own code.
> How can I get the user data submitted from the form in an ofbiz java service.
> ............
> <field name="username" title="UserName"><text/></filed>
> .............
> ............
> public Map checkUserLogin(DispatchContext ctx,Map context){
>
>        String username=(String) dctx.getAttribute("username");
> }
>
> I tried the above code..
> But it is giving null for the username.
> How can I do this.
> How can get the data from the DB in a java service?
> Please answer these ..It is very urgent.
> thanks and regards
> RamReddy
>
>
>
> This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient or received it in error, please contact the sender by reply e-mail and destroy all copies of the original message. Please do not copy it for any purpose or disclose its contents.
>
> Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights Reserved
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users