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

Support for HTTP forward #32

Open
chkal opened this issue Jul 19, 2020 · 5 comments
Open

Support for HTTP forward #32

chkal opened this issue Jul 19, 2020 · 5 comments

Comments

@chkal
Copy link
Contributor

chkal commented Jul 19, 2020

Issue by mvcbot
Tuesday Jan 13, 2015 at 18:01 GMT
Originally opened as mvc-spec/mvc-spec#35


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.

@chkal
Copy link
Contributor Author

chkal commented Jul 19, 2020

Comment by mvcbot
Friday Apr 17, 2015 at 12:49 GMT


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.

@chkal
Copy link
Contributor Author

chkal commented Jul 19, 2020

Comment by mvcbot
Friday May 29, 2015 at 13:16 GMT


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

?

@chkal
Copy link
Contributor Author

chkal commented Jul 19, 2020

Comment by mvcbot
Friday Jul 31, 2015 at 14:43 GMT


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.

@chkal
Copy link
Contributor Author

chkal commented Jul 19, 2020

Comment by mvcbot
Wednesday Aug 05, 2015 at 18:48 GMT


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?

@chkal
Copy link
Contributor Author

chkal commented Jul 19, 2020

Comment by chkal
Sunday Feb 11, 2018 at 13:00 GMT


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant