DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Spring JSF integration

Spring JSF integration

Mohammad Juma user avatar by
Mohammad Juma
·
Jul. 13, 11 · Java Zone · Interview
Like (0)
Save
Tweet
10.55K Views

Join the DZone community and get the full member experience.

Join For Free

integrating spring with jsf is easy, you just need to follow these steps:

1)in web.xml make sure that you have (context listener + context param) :

<listener>
<listener-class>
org.springframework.web.context.contextloaderlistener
</listener-class>
</listener>

<context-param>
<param-name>
contextconfiglocation
</param-name>
<param-value>
/web-inf/applicationcontext*.xml
</param-value>
</context-param>

2) you need to use “delegatingvariableresolver” in faces-config.xml:

<faces-config>
<application>
<variable-resolver>
org.springframework.web.jsf.delegatingvariableresolver
</variable-resolver>
…..
</faces-config>

3) in the managed bean where you want to use the spring bean, you need to add the spring bean to the managed bean class as a property:

<managed-bean>
<managed-bean-name>…</managed-bean-name>
<managed-bean-class>…</managed-bean-class>
<managed-bean-scope>…</managed-bean-scope>
<managed-property>
<property-name>manager</property-name>
<value>#{manager}</value>
</managed-property>
</managed-bean>

thats it :)

from http://java4you.wordpress.com/2011/07/11/spring-jsf-integration/

Spring Framework Integration

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Why I'm Choosing Pulumi Over Terraform
  • After COVID, Developers Really Are the New Kingmakers
  • Use Lambda Function URL To Write a Serverless App Backed by DynamoDB
  • Why Is Software Integration Important for Business?

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo