hstaudacher / osgi-jax-rs-connector

An OSGi - JAX-RS 2.0 Connector, software repository available on the link below
http://hstaudacher.github.io/osgi-jax-rs-connector
Other
191 stars 98 forks source link

How can i sendredirect to a new html in my own bundle #76

Closed zjpnju closed 9 years ago

zjpnju commented 9 years ago
I have a new bundle, create a new file WEB-INF and welcome.html in it
I want http://localhost/services/hello to be redirected to welcome.html

@Path(''/hello"") @GET public void sendRedirect(@Context HttpServletRequest servletRequest, @Context HttpServletResponse servletResponse) { System.out.println("welcome"); URI uri = uriInfo.getAbsolutePathBuilder().build(); Response.created(uri).build(); try { servletResponse.sendRedirect("./welcome.html"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }

The code above can't meet my requirement.. please help me

hstaudacher commented 9 years ago

See Response.seeOther( .. )