I am currently working on a project (contact IS) built using openlaszlo and I am using mysql as database... I use JSP as the servlet that will handle the connection to the database and present the information to openlaszlo as XML, however when I try to add a new contact through LzParams (laszlo parameters) and pass them onto jsp through: String myField=request.getParameter("myParamName") it returns a null value and that null value is inserted into my database...It is very annoying and I wish someone could help me with this....

Thanks in advance,

Loken:

Try using setAttribute in the servlet, and then getAttribute in the jsp page.

I am new to jsp and servlets as well, and i think(i could be wrong) that getParameter is normally used when getting the parameter from the url. If your url is: ...?maxvalue=5, using getParameter will display 5.

Are you sure that the element from which you are extracting the values in the previous page has the same value for name as the one you are using in the request.getParameter() method call

@Thirusha request.getParameter() in a JSP page can be used for both GET(the one you mentioned) and POST requests.

@Thirusha request.getParameter() in a JSP page can be used for both GET(the one you mentioned) and POST requests.

thanx stephen84s.

Thanks stephen84s and Thirusha,

I double checked my code and all the parameter names were consistent. I went through the entire code tracing for any bugs and found out my fault....I missed setting the parameters correctly on the Openlaszlo front-end that is why my Jsp isn't getting any values at all...

Thanks for your responses....

Best regards,

Loken

Thanks stephen84s and Thirusha,

I double checked my code and all the parameter names were consistent. I went through the entire code tracing for any bugs and found out my fault....I missed setting the parameters correctly on the Openlaszlo front-end that is why my Jsp isn't getting any values at all...

Thanks for your responses....

Best regards,

Loken

Hi loken,
Nice to meet u. Currently i also having problem on passing the parameter from jsp to laszlo. may i knw wat kind of method u r using to pass the parameter? dset or forward page? wanna knw wat parameters do i need to set correctly in order to get it work? If possible, can u post me ur sample of code for me to take it as a reference? Ur help is very much appreciated. Thanks a lot.

Regards,
cat_sin

If html form's tag enctype attribute is set with "multipart/form-data" then you cannot use request.getParameter.

If html form's tag enctype attribute is set with "multipart/form-data" then you cannot use request.getParameter.

Hi adatapost,

Nice to meet u and thanks for ur reply. I am using multipart/form-data. If cannot use request.getParameter, what method should i use? Hope to get ur guidance.Thanks a lot.

Regards,
cat_sin

You have to parse request body manually. You may use getInputStream() or getReader() Method of request object.

You have to parse request body manually. You may use getInputStream() or getReader() Method of request object.

Hi adatapost,

Thanks for ur reply. As what u suggested, how can we pass the request object to laszlo? Izit using forward page in JSP? And how can Laszlo accept the object. What method should laszlo call? Sorry for the stupid question cos i am quite new with JSP, Laszlo and HTML. Hope to get ur guidance. It is actually quite urgent for me. Thanks a lot.

Regards,
cat_sin

unfortunatily.... apachi dont suport this.. u need an extra java api tpo handle it::confused:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.