Foros de discusión

Build createAccountURL (to register) with parameters

thumbnail
Moisés Belda, modificado hace 9 años.

Build createAccountURL (to register) with parameters

Junior Member Mensajes: 75 Fecha de incorporación: 20/04/13 Mensajes recientes
Hi
I want to build a custom createAccountURL that I can pass parameters to default filled fields.

I have created url :

String createAccountURL = PortalUtil.getCreateAccountURL(request, themeDisplay);
createAccountURL = HttpUtil.setParameter(createAccountURL, "firstName", firstName);
createAccountURL = HttpUtil.setParameter(createAccountURL,"lastName", lastName);
createAccountURL = HttpUtil.setParameter(createAccountURL, "screenName", screenName);


Next I have redirect to this URL:

response.sendRedirect(createAccountURL);


Than I have overwrited create_account.jsp (with a hook)

System.out.println("firstName=> " + ParamUtil.getString(request,"firstName"));
System.out.println("lastName=> " +  ParamUtil.getString(request,"lastName"));
System.out.println("screenName=> " +  ParamUtil.getString(request,"screenName"));


All parameters are null and has not values....

What's the problem?
thumbnail
Moisés Belda, modificado hace 9 años.

RE: Build createAccountURL (to register) with parameters

Junior Member Mensajes: 75 Fecha de incorporación: 20/04/13 Mensajes recientes
Solved !

request.getRequestDispatcher(createAccountURL).forward(request, response);
return;


Forward is the solution! Not sendRedirect!