Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faces 4.0: remove deprecated ResourceResolver #1583

Closed
BalusC opened this issue Sep 12, 2021 · 2 comments
Closed

Faces 4.0: remove deprecated ResourceResolver #1583

BalusC opened this issue Sep 12, 2021 · 2 comments
Labels
mojarra-implemented API issue implemented by Mojarra myfaces-implemented API issue implemented by MyFaces
Milestone

Comments

@BalusC
Copy link
Member

BalusC commented Sep 12, 2021

ResourceResolver was deprecated since 2.2:

 * <span class="changed_deleted_2_2">Deprecated as of Jakarta Server Faces 2.2. The same functionality is more correctly
 * provided by {@link jakarta.faces.application.ResourceHandler}.</span> Provide a hook to decorate or override the way
 * that Facelets loads template files. A default implementation must be provided that satisfies the requirements for
 * loading templates as in Pre-Jakarta Server Faces 2.0 Facelets.

It's time to remove it.

For a real world example of migration from ResourceResolver to ResourceHandler, take this OmniFaces commit as an example: omnifaces/omnifaces@65d6c3a#diff-2fcedbdaa1d6c98f1597f920fff6e3611c18e9320c2201f8ae4c174d7e3656e1

Summary, this usage of ResourceResolver

public class YourResourceResolver extends ResourceResolver {

	private final ResourceResolver wrapped;

	public YourResourceResolver(ResourceResolver wrapped) {
		this.wrapped = wrapped;
	}

	@Override
	public URL resolveUrl(String path) {
                String actualPath = doYourMagicWith(path);
		URL resource = wrapped.resolveUrl(actualPath);
		return resource;
	}

}

can be rewritten to this usage of ResourceHandler

public class YourResourceHandler extends ResourceHandlerWrapper {

	public YourResourceHandler(ResourceHandler wrapped) {
		super(wrapped);
	}

	@Override
	public ViewResource createViewResource(FacesContext context, String path) {
                String actualPath = doYourMagicWith(path);
		ViewResource resource = super.createViewResource(context, actualPath);
		return resource;
	}

}
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Sep 12, 2021
Remove deprecated ResourceResolver from API
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Sep 12, 2021
Remove deprecated ResourceResolver from impl
@arjantijms arjantijms added this to the 4.0 milestone Sep 12, 2021
@arjantijms arjantijms added the 4.0 label Sep 12, 2021
@tandraschko
Copy link

also done in MF, please close

@arjantijms arjantijms added mojarra-implemented API issue implemented by Mojarra myfaces-implemented API issue implemented by MyFaces labels Sep 13, 2021
@arjantijms
Copy link
Contributor

also done in MF, please close

Thanks, I added labels to indicate whether it's implemented.

liptga pushed a commit to liptga/spring-webflow that referenced this issue Feb 1, 2023
- FlowResourceResolver.java is removed, since was deprecated - see jakartaee/faces#1583
rstoyanchev pushed a commit to spring-projects/spring-webflow that referenced this issue Mar 27, 2023
FlowResourceResolver.java is removed, since it was deprecated, see
jakartaee/faces#1583

See gh-1794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mojarra-implemented API issue implemented by Mojarra myfaces-implemented API issue implemented by MyFaces
Projects
None yet
Development

No branches or pull requests

3 participants