concept url in category java

appears as: URL, URLs, URL, URLs, url, The URL, url
Play for Java

This is an excerpt from Manning's book Play for Java.

In order to give our new hello() method a URL to reach it by, we’ll need to create a route for it. Add a new line to the conf/routes file to map the /hello to our new method, including the String parameter called name:

Let’s take a look at another example. To display the first page of a product listing, a URL could be http://localhost/product?page=1. It would decomposed as shown in figure 5.7.

Figure 5.7. Request with query string

The HTTP method can be any of the valid methods supported by HTTP (GET, POST, PUT, DELETE, or HEAD). The request path identifies the resource we’re trying to serve. Query strings are optional and are used to provide dynamic parameters. A query string is specified after the ? sign and is always of the form name=value. We assume you know all about what a URL is and what HTTP methods are. If not, please read about them in chapter 3.

5.3. Using routing to wire URLs to action methods

We now know how we can render some content and how to execute business logic. But how do we link the controller method to be executed to the URL that the client invokes?

Making Java Groovy: Foreword by Guillaume Laforge

This is an excerpt from Manning's book Making Java Groovy: Foreword by Guillaume Laforge.

The URL shown is hard-wired to produce the chart in figure 2.1. To make this more general, I’ll show how to produce the URL from strings, lists, maps, closures, and builders.

To send an HTTP GET request to a URL and retrieve the results, convert the string to a URL and invoke another Groovy JDK method, the getText() method, added to java.net.URL. In other words, the data on a web page can be retrieved from this code:

Griffon in Action

This is an excerpt from Manning's book Griffon in Action.

The manual way gives you more choices in source storage because you’re fully responsible for adding plugins to your source control system. You’re free to choose the hosting solution for the plugin’s zip file and source code. The drawback is that the plugin won’t be visible with the list-plugins and plugin-info command targets, at least not until custom plugin repositories become available in Griffon.[2] You basically package the plugin using the method you now know, and then publish the zip file to a URL where other people can download it.

You’ll notice that the third method defines a URL that points to the server running the Grails app, whereas the other methods don’t. It’s your intention to call the third method first in order to set up the HTTPBuilder object and later reuse it for any subsequent queries. That’s why there’s an id property defined as well. When the id property is present, it means that a reference to the internal HTTPBuilder will be saved in an in-memory storage managed by the REST plugin. There’s no need to pay a penalty for setting up a new HTTPBuilder for each query made, is there?

Spring Roo in Action

This is an excerpt from Manning's book Spring Roo in Action.

This method is mapped to /courses. When you ask to GET tasks based on this URL, the controller fetches all of the tasks and places them in ${courses} to render in the view. The controller supports paging results if the page and size parameters are passed as parameters to the URL; otherwise it fetches all rows. The controller also tells the view how many pages of rows were available, if paging was enabled.

Note that the access attribute is populated with a permitAll value for some of the URL patterns. This configuration allows all users access to the URLs matching the pattern value specified in the pattern attribute of the intercept-url element. In real-world applications, you shouldn’t allow access to URLs that aren’t explicitly protected. If a user tries to access a URL that’s not specified, you should use a denyAll value to prevent access to the pattern that the URL matches. This approach gives you better control over what URLs in the application are accessible to a specific group of users and results in a more secure web application.

Portlets in Action

This is an excerpt from Manning's book Portlets in Action.

For example, if you try to access My Home Page without authenticating with Liferay Portal, the URL will be

Figure 5.20. The Configuration option for the RSS portlet lets you specify the URL from which to receive the RSS feeds.
  • <param>—Used to add parameters to portlet URLs
  • name—Specifies the name of the property that you want to add to the URL