When I call another action in one action, it also displays the template itself, in Play 1.1 RC and when I do Redirect("...url"), but it doesnโt work, is there anyone who can help me?
Redirect("...url")
To add to the answers above, here is how you redirect the external URL:
public static void index () {redirects ("http://geeks.aretotally.in"); }
To redirect, you simply call an action. From the example in the documentation :
public static void show(Long id) { Article article = Article.findById(id); render(article); } public static void edit(Long id, String title) { Article article = Article.findById(id); article.title = title; article.save(); show(id); }
(...) , URL-, show.
/ , . conf/routes .
conf/routes
, , , , - .
Conf/:
GET /admin Application.redirect(url:'/admin/index.html')
//Application.java:
public class Application extends Controller { public static void redirect(String url) { redirect(url, true); } }
, , , .
, Contoller Application
public static void index()
app/views/Application/index.html
, .
,
renderTemplate("Application/myOtherTemplate.html");
, URL- .
Source: https://habr.com/ru/post/1777023/More articles:What is the difference between the two declarations in c? - cHow can I back up mysql database from java? - javaAndroid OutOfMemoryError - javahow can I backup and restore date from mysql database - javahow to create dynamic data for an item in a list - androidDoes the list of initializers include a constructor call? - c ++Parsing large XML files on Android - androidHow to access dll to build datetime in C # - c #How to get HTML code of a page in C # when headers are set to HTTP / 1.0 404 Not found - htmlHiding iAds programmatically in iPhone - iphoneAll Articles