jsp - Using JSF as view technology of Spring MVC -


i implementing small spring mvc poc, , use jsf view technology since people in company used j2ee primefaces environment.

does spring mvc 3 support jsf, or jsp? have read multiple articles mixing two.

my need create appealing ui. there simple way using spring mvc jsp view technology?

our application uses schedules/calendars in multiples pages. it's time management app

you're making conceptual mistake. jsf not view technology. jsf mvc framework. spring mvc, albeit have both different ideology; jsf component based mvc , spring mvc request based mvc. full competitors. cannot mix them. should choose 1 or other. instead, jsp , facelets true view technologies. since java ee 6 (december 2009), jsp deprecated , replaced facelets (xhtml) default view technology jsf.

you can use spring mvc jsp view technology. can use spring mvc facelets view technology (and many others). can not use spring mvc jsf components let alone jsf component libraries primefaces. not making sense. spring mvc has own <form:xxx> tags already. if want use same ui primefaces, grab jquery ui. it's primefaces using under covers. primefaces jquery-based jsf component library.

from other side on, can confused spring ioc/di spring mvc. spring ioc/di in turn usable jsf. can replace jsf managed bean facility (@managedbean , friends) spring managed bean facility (@component , friends), sole purpose in order use @autowired in jsf backing bean. that's it. jsf mvc framework lifecycle, jsf components , view technology remain unchanged. standard java ee equivalent of using cdi (and ejb).

the same story applies spring security. can use jsf, should not follow spring security + spring mvc targeted documentation/examples in order configure it, spring security + jsf ones. note spring security constraints on business actions works when replace jsf managed bean facility spring managed bean facility. still require "integrate spring in jsf" described in previous paragraph. standard java ee equivalent of using container managed security (jaas/jaspic) via <security-constraint> entries in web.xml.

the same story applies spring webflow. need make sure you're using recent version of spring webflow older versions cause conflicts when used multiple jsf component libraries. moreover, since jsf 2.2, new faces flows feature introduced part of standard java ee api, hereby making spring webflow superfluous.

then there spring boot. not have direct equivalent in java ee. spring boot enables execute java ee application using plain java application class main() method "in easy , abstract way". without spring boot it's surely possible (otherwise spring boot never have existed), it's bit more work configuration have take account server-specific details based on documentation. example: undertow , jetty.

coming jsf , spring mvc, if necessary, can safely run spring mvc , jsf next each other in same web application, won't interoperate in server side. run independently. @ touch each other in client side, if javascript in jsf-generated html page happens invoke spring based rest web service call in same web application. spring web service not need/have know jsf in order respond accordingly. standard java ee equivalent of spring rest webservice jax-rs.

the upcoming java ee 8 come new request based mvc framework, named "mvc", based on lessons of both jsf , spring mvc, hereby supplanting spring mvc , providing standard alternative jsf.

see also:


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -