Sunday, 15 March 2015

mvc pattern in java ee and migrating from spring to java ee 7 -



mvc pattern in java ee and migrating from spring to java ee 7 -

i used spring mvc in next manner:

@controller class mycontrollerclass { @requestmapping... method(){ servicecall()... //put modelandview object here , redirect jsp page. homecoming "home"; // redirect info home.jsp } } @service class myserviceclass{ @transactional someservicemethod(){ daomethod(); } } @repository class mydaoclass{ daomethdon(){...} } /view/myjsps.jsp path view directory set in spring.xml

question:

can body explain me (preferably actual real world code example(s)), alternatives have, above mentioned mvc pattern, in java ee 6/7. ie. controller, service, dao, view layers.

further more, how redirect pages, (i believe plain requestdispatcher old way of doing things, there got automated ways. same goes modelandview.

i have googled lot find spring mvc examples.

java ee doesn't have 'standard' mvc package. if go straight java ee you'll dealing straight httpservletrequests, portletrequests etc. putting objects in 'model' in plain java ee httpservletrequest.setattribute(), or httpsession.setattribute() (if @sessionattributes)

spring java-ee spring-mvc java-ee-6 java-ee-7

No comments:

Post a Comment