You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have already tried this example three times but everytime its getting stuck with same problem...
Next the JSF2.2 fileuploadexample is also not working I have tried atleast twice once with my own code and second time I used your code as mentioned over here plz help me with both the issues
The text was updated successfully, but these errors were encountered:
web.xml
javax.faces.PROJECT_STAGE Development javax.faces.CLIENT_WINDOW_MODE urlbooking.xhtml
MovieFacadeREST
package com.mycompany.movieplex7.rest;
import com.mycompany.movieplex7.entities.Movie;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
*
@author justme
*/
@stateless
@path("movie")
public class MovieFacadeREST extends AbstractFacade {
@PersistenceContext(unitName = "movieplex7PU")
private EntityManager em;
public MovieFacadeREST() {
super(Movie.class);
}
@post
@OverRide
@consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public void create(Movie entity) {
super.create(entity);
}
@put
@path("{id}")
@consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public void edit(@PathParam("id") Integer id, Movie entity) {
super.edit(entity);
}
@delete
@path("{id}")
public void remove(@PathParam("id") Integer id) {
super.remove(super.find(id));
}
@get
@path("{id}")
@produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Movie find(@PathParam("id") Integer id) {
return super.find(id);
}
@get
@OverRide
@produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public List findAll() {
return super.findAll();
}
@get
@path("{from}/{to}")
@produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public List findRange(@PathParam("from") Integer from, @PathParam("to") Integer to) {
return super.findRange(new int[]{from, to});
}
@get
@path("count")
@produces(MediaType.TEXT_PLAIN)
public String countREST() {
return String.valueOf(super.count());
}
@OverRide
protected EntityManager getEntityManager() {
return em;
}
}
ApplicationConfig
package com.mycompany.movieplex7.rest;
import java.util.Set;
import javax.ws.rs.core.Application;
/**
*
@author justme
*/
@javax.ws.rs.ApplicationPath("webresources")
public class ApplicationConfig extends Application {
@OverRide
public Set<Class> getClasses() { Set> resources = new java.util.HashSet<>();
addRestResourceClasses(resources);
return resources;
}
/**
*/
private void addRestResourceClasses(Set<Class<?>> resources) {
resources.add(com.mycompany.movieplex7.rest.MovieFacadeREST.class);
resources.add(com.mycompany.movieplex7.rest.SalesFacadeREST.class);
resources.add(com.mycompany.movieplex7.rest.ShowTimingFacadeREST.class);
resources.add(com.mycompany.movieplex7.rest.TheaterFacadeREST.class);
resources.add(com.mycompany.movieplex7.rest.TimeslotFacadeREST.class);
resources.add(org.glassfish.movieplex7.json.MovieReader.class);
resources.add(org.glassfish.movieplex7.json.MovieWriter.class);
}
}
Pom.xml
4.0.0I have already tried this example three times but everytime its getting stuck with same problem...
Next the JSF2.2 fileuploadexample is also not working I have tried atleast twice once with my own code and second time I used your code as mentioned over here plz help me with both the issues
The text was updated successfully, but these errors were encountered: