[opencms-dev] MVC in Opencms: how to get the pageContext into the model?

Alexandre Morozov morozov at codecentric.de
Wed Feb 6 15:59:42 CET 2008


Hi Aden,

I think it is not possible to have the PageContext Object in the Struts Action... Do you really need PageContext Object in your NewUserBean? 

Regards,
Alex Morozov

codecentric GmbH
Grünewalder Str. 29-31
42657 Solingen

Telefon +49 (212) 2494 - 331
Fax +49 (212) 2494 - 334
Mobil +49 (151) 16706497
E-Mail morozov at codecentric.de
Internet www.codecentric.de
Geschäftsführer: Peter Gierse, Mirko Novakovic und Rainer Vehns
Sitz der Gesellschaft: Solingen


-----Original Message-----
From: opencms-dev-bounces at opencms.org on behalf of aden
Sent: Wed 2/6/2008 3:27 PM
To: opencms-dev at opencms.org
Subject: [opencms-dev] MVC in Opencms: how to get the pageContext into the model?
 

I want to start with MVC-architecture (type 2) without struts or jsf. 

So my idea is following: The view start the controller with html-code for
instance <form name="form" method="post" action="/opencms/Controller.do">,
then the controller should init() the model for instance
NewUserBean(pageContext, request, response ) and  collect the "result" from
the model-method NewUserBean.newUser( bla-bla, ...) und put it in an
RequestDispatcher. So the view.jsp is called and this have access to the
"result" and show the page.

But how I get the PageContext in this controller? Please send me some
code-pieces for help. Or I am completly wrong with this controller-code?

thanks.

public class Controller extends OpenCmsServlet{

public void doPost ( HttpServletRequest request, HttpServletResponse
response) throws IOException, ServletException{

NewUserBean ub = new NewUserBean( !!pageContext!!, request, response );
result = ub.newUser( emailName, lastName, firstName, password1, password2,
addInfos, group );
				
request.setAttribute("result", result);
RequestDispatcher rd = request.getRequestDispatcher( "/view.jsp" );
rd.forward(request, response);
}
}
-- 
View this message in context: http://www.nabble.com/MVC-in-Opencms%3A-how-to-get-the-pageContext-into-the-model--tp15306671p15306671.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.


_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 4017 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20080206/95732a5e/attachment.bin>


More information about the opencms-dev mailing list