Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.

Support for HTTP forward #35

Closed
mvcbot opened this issue Jan 13, 2015 · 6 comments
Closed

Support for HTTP forward #35

mvcbot opened this issue Jan 13, 2015 · 6 comments
Milestone

Comments

@mvcbot
Copy link

mvcbot commented Jan 13, 2015

Original issue MVC_SPEC-23 created by Santiago Pericas-Geertsen:

JAX-RS 2.1 is likely to support a redirect call (just like servlet). This issue is recorded to track if whatever support is added to JAX-RS is sufficient for MVC.

@mvcbot
Copy link
Author

mvcbot commented Apr 17, 2015

Comment by Santiago Pericas-Geertsen:

Ozark implements redirect using the "redirect:" prefix. For example,

return "redirect:/foo";

which seems very convenient for controller methods returning strings.

@mvcbot
Copy link
Author

mvcbot commented May 29, 2015

Comment by peter_pilgrim:

Ok.

How do you get to the request.getContextPath() of your application then?

@POST
@Controller
@Path("edit/{id}")
@Produces("text/html")
public Viewable editProduct( @PathParam("id") int id,
                             @FormParam("action") String action,
                             @FormParam("name") String name,
                             @FormParam("description") String description,
                             @FormParam("price") double price )
{
    if ("Save".equalsIgnoreCase(action)) {
       /** ,,,**/
    }
    retrieveAll();
    return new Viewable("redirect:/products.jsp");
}

}

The "redirect:/products.jsp" will alter the URI and still include the Application Path URI e.g.

 http://localhost:8080/acme/gateway/product.jsp

This is probably not what the developer/designer wants. Instead they want

 http://localhost:8080/acme/product.jsp

Assuming the "/acme" is the servlet context path

?

@mvcbot
Copy link
Author

mvcbot commented Jul 31, 2015

Comment by Santiago Pericas-Geertsen:

The relative path resolution is currently documented to be compatible with javax.ws.rs.core.Response#seeOther, which is also available to MVC controllers that return a Response.

@mvcbot
Copy link
Author

mvcbot commented Aug 5, 2015

Comment by Manfred Riem:

I think what he is saying what if you want to break out of the servlet path, but instead want to target the context path?

@mvcbot mvcbot added this to the 1.0-pr milestone Apr 26, 2017
@chkal chkal removed this from the 1.0-pr milestone Dec 18, 2017
@chkal chkal added this to the Future milestone Feb 11, 2018
@chkal
Copy link
Contributor

chkal commented Feb 11, 2018

I don't think it is worth to include this in 1.0. Any objections?

@chkal
Copy link
Contributor

chkal commented Jul 19, 2020

Moved to jakartaee/mvc#32

@chkal chkal closed this as completed Jul 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants