issue setting up RegisteredServiceThemeBasedViewResolver in 4.2

70 views
Skip to first unread message

Nancy Snoke

unread,
Apr 20, 2016, 4:49:28 PM4/20/16
to cas-...@apereo.org

I was setting up several custom themes in 4.2.0.  The basic themes (css and js)are working fine.

 

I wanted to try the new RegisteredServiceThemeBasedViewResolver for theme based ui views.

 

In the cas-servlet I uncommented the internalViewResolver bean. 

I added a directory in WEF-INF/view/jsp with my theme name, then in ui directory under that added an updated jsp I wanted to use.

 

Basic theme worked / theme based ui view did not.

 

Then I tried changing the  order  number of the internalViewResolver bean.

 

Basic theme worked / theme based ui view did not.

 

Then I took a look at the source code and enabled the logging for org.jasig.cas.services.web.  I saw in the log that the serviceThemeResolver was handling the request instead of the RegisteredServiceThemeBasedViewResolver.

 

So, I found the declaration for the serviceThemeResolver in the deployerContextCongig.  I commented it out and then I got a 500 error.

 

Then I tried setting the internalViewResolver bean in the deployerContextConfig and also got a 500 error.

 

Any suggestions?

 

Thanks,

Nancy

 

Siim

unread,
Apr 28, 2016, 7:37:47 AM4/28/16
to CAS Community, NSn...@thegeneral.com
Hello,

I am having similar issue. I used this overlay project https://github.com/Jasig/cas-overlay-template
Everything works like a charm with ServiceThemeResolver, when I followed these instructions. https://jasig.github.io/cas/4.2.x/installation/User-Interface-Customization.html#servicethemeresolver

But if I try to configure RegisteredServiceThemBasedViewResolver, I cannot get it to work. In my overlay, my cas-servlet.xml looks like this
http://pastebin.com/VQiAuyP5

I have cloned defeault set of view pages to into new directory (in overlay /WEB-INF/view/jsp/<theme-id>/ui/) and commented out this block in cas-servlext.xml

<bean id="internalViewResolver" class="org.jasig.cas.services.web.RegisteredServiceThemeBasedViewResolver"
           
c:servicesManager-ref="servicesManager"
           
p:prefix="${cas.themeResolver.pathprefix:/WEB-INF/view/jsp}"
           
p:order="2001"/>

Do I need to configure something more? In cas.properties? Something in deployeConfig.xml or in webFlowContext.xml ? Or do I need some dependencies in my overlay project pom.xml?


Thanks,
Siim

Misagh Moayyed

unread,
Apr 28, 2016, 3:48:07 PM4/28/16
to CAS Community, NSn...@thegeneral.com

For the time being, remove/undo changes you did to cas-servlet, and instead put this in your deployerConfigContext.xml file:

 

    <bean id="internalViewResolver" class="org.jasig.cas.services.web.RegisteredServiceThemeBasedViewResolver"

          c:servicesManager-ref="servicesManager"

          p:suffix=".jsp"

          p:prefix="${cas.themeResolver.pathprefix:/WEB-INF/view/jsp}"

          p:order="10000"/>

 

This will become the default going forward, so you can later remove it as you upgrade through the series.

 

--
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To post to this group, send email to cas-...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/c975547b-e569-45bd-87e8-0ea43b53a29c%40apereo.org.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.

Siim

unread,
Apr 29, 2016, 10:55:04 AM4/29/16
to CAS Community, NSn...@thegeneral.com, mmoa...@unicon.net
Thanks, finally it works. I am new to CAS and spend many hours for it and could not figure it out. But solution was simple.

So thanks again,
Siim
Reply all
Reply to author
Forward
0 new messages