A Walking Tour of the Struts 2 MailReader Application
This article is meant to introduce a new user to Apache Struts 2 by "walking through" a simple, but functional, application. The article includes code snippets, but for the best result, you might want to install the MailReader application on your own development workstation and follow along. Of course, the full source code to the MailReader is included in the distribution.
The tour assumes the reader has a basic understanding of the Java language, JavaBeans, web applications, and JavaServer Pages. For background on these technologies, see the Key Technologies Primer.
The premise of the MailReader is that it is the first iteration of a portal application. This version allows users to register and maintain a set of accounts with various mail servers. If completed, the application would let users read mail from their accounts.
The MailReader application demonstrates registering with an application, logging into an application, maintaining a master record, and maintaining child records. This article overviews the constructs needed to do these things, including the server pages, Java classes, and configuration elements.
For more about the MailReader, including alternate implementations and a set of formal Use Cases, please visit the Struts University MailReader site.
JAAS - Note that for compatibility and ease of deployment, the MailReader uses "application-based" authorization. However, use of the standard Java Authentication and Authorization Service (JAAS) is recommended for most applications. (See the Key Technologies Primer for more about authentication technologies.)
The tour starts with how the initial welcome page is displayed, and then steps through logging into the application and editing a subscription. Please note that this not a quick peek at a "Hello World" application. The tour is a rich trek into a realistic, best practices application. You may need to adjust your chair and get a fresh cup of coffee. Printed, the article is 29 pages long (US).
Welcome Page
A web application, like any other web site, can specify a list of welcome pages. When you open a web application without specifying a particular page, a default "welcome page" is served as the response.
web.xml
When a web application loads, the container reads and parses the "Web Application Deployment Descriptor", or "web.xml" file. The framework plugs into a web application via a servlet filter. Like any filter, the "struts2" filter is deployed via the "web.xml".
web.xml - The Web Application Deployment Descriptor
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <display-name>Struts 2 MailReader</display-name> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>  <listener> <listener-class> mailreader2.ApplicationListener </listener-class> </listener> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app>
You might note that the web.xml configuration does not specify which file extension to use with actions. The default extension for Struts 2 is ".action", but the extension can be changed in the struts.properties file. For compatability with prior releases, the MailReader uses a .do extension for actions.
struts.properties
struts.action.extension = do
The web.xml does specify a "Welcome File List" for the application. When a web address refers to a directory rather than an individual file, the container consults the Welcome File List for the name of a page to open by default.
However, most Struts applications do not refer to physical pages, but to "virtual resources" called actions. Actions specify code that we want to be run before a page or other resource renders the response. An accepted practice is to never link directly to server pages, but only to logical action mappings. By linking to actions, developers can often "rewire" an application without editing the server pages.
Best Practice:
"Link actions not pages."
The actions are listed in one or more XML configuration files, the default configuration file being named "struts.xml". When the application loads, the struts.xml, and any other files it includes, are parsed, and the framework creates a set of configuration objects. Among other things, the configuration maps a request for a certain page to a certain action mapping.
Sites can list zero or more "Welcome" pages in the web.xml. Unless you are using Java 1.5, actions cannot be specified as a Welcome page. So, in the case of a Welcome page, how do we follow the best practice of navigating through actions rather than pages?
One solution is to use a page to "bootstrap" one of our actions. We can register the usual "index.html" as the Welcome page and have it redirect to a "Welcome" action.
MailReader's index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  <META HTTP-EQUIV="Refresh" CONTENT="0;URL=Welcome.do">
Loading ...

As an alternative, we could also have used a JSP page that issued the redirect with a Struts tag, but a plain HTML solution works as well.
Welcome.do
When the client requests "Welcome.do", the request is passed to the "struts2" FilterDispatcher (that we registered in the web.xml file). The FilterDispatcher retrieves the appropriate action mapping from the configuration. If we just wanted to forward to the Welcome page, we could use a simple configuration element.
A simple "forward thru" action element
<action name="Welcome"> <result>/pages/Welcome.jsp</result> </action>
If a client asks for the Welcome action ("Welcome.do"), the "/page/Welcome.jsp" page would be returned in response. The client does not know, or need to know, that the physical resource is located at "/pages/Welcome.jsp". All the client knows is that it requested the resource "Welcome.do".
But if we peek at the configuration file for the MailReader, we find a slightly more complicated XML element for the Welcome action.
The Welcome action element
<action name="Welcome" class="org.apache.struts.examples.mailreader2.Welcome"> <result>/pages/Welcome.jsp</result> <interceptor-ref name="guest"/> </action>
Here, the Welcome Java class executes whenever someone asks for the Welcome action. As it completes, the Action class can select which "result" is displayed. The default result name is "success". Another available result, defined at a global scope, is "error".
Key concept:
The Action class doesn't need to know what result type is needed for "success" or "error". The Action can just return the logical name for a result, without knowing how the result is implemented.
The net effect is that all of the result details, including the paths to server pages, all can be declared once in the configuration. Tightly coupled implementation details are not scattered all over the application.
Key concept:
The Struts configuration lets us separate concerns and "say it once". The configuration helps us "normalize" an application, in much the same way we normalize a database schema.
OK ... but why would a Welcome Action want to choose between "success" and "error"?
Welcome Action
The MailReader application retains a list of users along with their email accounts. The application stores this information in a database. If the application can't connect to the database, the application can't do its job. So before displaying the Welcome page, the Welcome class checks to see if the database is available.
The MailReader is also an internationalized application. So, the Welcome Action class checks to see if the message resources are available too. If both resources are available, the class passes back the "success" token. Otherwise, the class passes back the "error" token, so that the appropriate messages can be displayed.
The Welcome Action class
package mailreader2; public class Welcome extends MailreaderSupport { public String execute() { // Confirm message resources loaded String message = getText(Constants.ERROR_DATABASE_MISSING); if (Constants.ERROR_DATABASE_MISSING.equals(message)) { addActionError(Constants.ERROR_MESSAGES_NOT_LOADED); } // Confirm database loaded if (null==getDatabase()) { addActionError(Constants.ERROR_DATABASE_NOT_LOADED); } if (hasErrors()) { return ERROR; } else { return SUCCESS; } } }
Several common result names are predefined, including ERROR, SUCCESS, LOGIN, NONE, and INPUT, so that these tokens can be used consistently across Struts 2 applications.
Global Results
As mentioned, "error" is defined in a global scope. Other actions may have trouble connecting to the database later, or other unexpected errors may occur. The MailReader defines the "error" result as a Global Result, so that any action can use it.
MailReader's global-result element
<global-results> <result name="error">/pages/Error.jsp</result> <result name="invalid.token">/pages/Error.jsp</result> <result name="login" type="redirect-action">Login_input</result> </global-results>
Of course, if an individual action mapping defines its own "error" result type, the local result would be used instead.
ApplicationListener.java
The database is exposed as an object stored in application scope. The database object is based on an interface. Different implementations of the database could be loaded without changing the rest of the application. But how is the database object loaded in the first place?
The database is created by a custom Listener that we configured in the "web.xml".
org.apache.struts.examples.mailreader2.ApplicationListener
<listener> <listener-class> org.apache.struts.examples.mailreader2.ApplicationListener </listener-class> </listener>
By default, our ApplicationListener loads a MemoryDatabase implementation of the UserDatabase. MemoryDatabase stores the database content as a XML document, which is parsed and loaded as a set of nested hashtables. The outer table is the list of user objects, each of which has its own inner hashtable of subscriptions. When you register, a user object is stored in this hashtable. When you login, the user object is stored within the session context.
The database comes seeded with a sample user. If you check the "database.xml" file under "/src/main/resources", you'll see the sample user described in XML.
The "seed" user element from the MailReader database.xml
<user username="user"<EMAIL_ADDRESS>fullName="John Q. User" password="pass"> <subscription host="mail.hotmail.com" autoConnect="false" password="bar" type="pop3" username="user1234"> </subscription> <subscription host="mail.yahoo.com" autoConnect="false" password="foo" type="imap" username="jquser"> </subscription> </user>
The "seed" user element creates a registration record for "John Q. User", with the subscription detail for his hotmail and yahoo accounts.
Message Resources
As mentioned, MailReader is an internationalized application. In Struts 2, message resources are associated with the Action class being processed. If we check the source, we find a language resource bundle named MailreaderSupport. MailreaderSupport is our base class for all the MailReader Actions. Since all of our Actions extend MailreaderSupport, all of our Actions can use the same resource bundle.
Message Resource entries used by the Welcome page
index.heading=MailReader Application Options index.login=Log on to the MailReader Application index.registration=Register with the MailReader Application index.title=MailReader Demonstration Application index.tour=A Walking Tour of the MailReader Demonstration Application
If you change a message in the resource, and then rebuild and reload the application, the change will appear throughout the application. If you provide message resources for additional locales, you can localize your application. The MailReader provides resources for English, Russian, and Japanese.
Welcome Page
After confirming that the necessary resources exist, the Welcome action forwards to the Welcome page.
 These are just the usual red tape that goes with any JSP file. The rest of the page utilizes three Struts JSP tags: "text", "url", and "i18n".
(We use the tag prefix "s:" in the Struts 2 MailReader application, but you can use whatever prefix you like in your applications.)
The text tag inserts a message from an application's default resource bundle. If the framework's locale setting is changed for a user, the text tag will render messages from the new locale's resource bundle instead.
The url tag can render a reference to an action or any other web resource, applying "URL encoding" to the hyperlinks as needed. Java's URL encoding feature lets your application maintain client state without requiring cookies.
 (If you are using Internet Explorer and try this, be sure you reset cookies for the appropriate security zone, and that you disallow "per-session" cookies.)
The i18n tag provides access to multiple resource bundles. The MailReader application uses a second set of message resources for non-text elements. When these are needed, we use the "i18n" tag to specify a different bundle.
The alternate bundle is stored in the {{/src/main/resources}} folder, so that it ends up under "classes", which is on the application's class path.
In the span of a single request for the Welcome page, the framework has done quite a bit already:
- Confirmed that required resources were loaded during initialization.
- Written all the page headings and labels from internationalized message resources.
- Automatically URL-encoded paths as needed.
When rendered, the Welcome page lists two menu options: one to register with the application and one to log on (if you have already registered). Let's follow the Login link first.
Login
If you choose the Login link, and all goes well, the Login action forwards control to the Login page.
Login Page
The Login page displays a form that accepts a username and password. You can use the default username and password to login (user and pass), if you like. Try omitting or misspelling the username and password in various combinations to see how the application reacts. Note that both the username and password are case sensitive.
Login.jsp
<%@ page contentType="text/html; charset=UTF-8" %> <%@ taglib prefix="s" uri="http://struts.apache.org/tags" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   <title><s:text name="login.title"/></title> <link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet" type="text/css"/>   <s:actionerror/> <s:form action="Login" validate="true"> <s:textfield key="username"/> <s:password key="password"/> <s:submit key="button.save"/> <s:reset key="button.reset"/> <s:submit action="Login_cancel" onclick="form.onsubmit=null" key="button.cancel"/> </s:form> <jsp:include page="Footer.jsp"/>
We already saw some of the tags used by the Login page on the Welcome page. Let's focus on the new tags.
The first new tag on the Login page is actionerrors. Most of the possible validation errors are related to a single field. If you don't enter a username, the framework can place an error message near the tag prompting you to enter a username. But some messages are not related to a single field. For example, the database might be down. If the action returns an "Action Error", as opposed to a "Field Error", the messages are rendered in place of the "actionerror" tag. The text for the validation errors, whether they are Action Errors or Field Errors, can be specified in the resource bundle, making the messages easy to manage and localize.
The second new tag is form. This tag renders a HTML form tag. The "validate=true" setting enables client-side validation, so that the form can be validated with JavaScript before being sent back to the server. The framework will still validate the form again, just to be sure, but the client-side validation can save a few round-trips to the server.
Within the form tag, we see four more new tags: "textfield", "password", "submit", and "reset". We also see a second usage of "submit" that utilizes an "action" attribute.
When we place a control on a form, we usually need to code a set of HTML tags to do everything we want to do. Most often, we do not just want a plain "input type=text" tag. We want the input field to have a label too, and maybe even a tooltip.
The Struts Tags support templates and themes so that a set of HTML tags can be rendered from a single Struts Tag. For example, the single tag
<s:textfield key="username"/>
generates a wad of HTML markup.

  Username: 	  <input type="text" name="username" value="" id="Login_username"/>

If for some reason you don't like the markup generated by a Struts Tag, it's each to change. Each tag is driven by a template that can be updated on a tag-by-tag basis. For example, here is the default template that generates the markup for the ActionErrors tag:
<#if (actionErrors?exists && actionErrors?size > 0)>
 <#list actionErrors as error>
${error}
 </#list>
 </#if>
If you wanted ActionErrors displayed in a table instead of a list, you could edit a copy of this file, save it as a file named "template/simple/actionerror.ftl", and place this one file at the base of your application's classpath.
<#if (actionErrors?exists && actionErrors?size > 0)>
 <#list actionErrors as error>
${error}
 </#list>
 </#if>
Under the covers, the framework uses Freemarker for its standard templating language. FreeMarker is similar to Velocity, but it offers better error reporting and some additional features. If you prefer, Velocity and JSP templates can also be used to create your own tags.
The password tag renders a "input type=password" tag, along with the usual template/theme markup. By default, the password tag will not retain input if the submit fails. If the username is wrong, the client will have to enter the password again too. (If you did want to retain the password when validation fails, you can set the tag's "showPassword" property to true.)
Unsurprisingly, the submit and reset tags render buttons of the corresponding types.
The second submit button is more interesting.
<s:submit action="Login_cancel" onclick="form.onsubmit=null" key="button.cancel"/>
Here we are creating the Cancel button for the form. The button's attribute action="Login_cancel" tells the framework to submit to the Login's "cancel" method instead of the usual "execute" method. The onclick="form.onsubmit=null" script defeats client-side validation. On the server side, "cancel" is on a special list of methods that bypass validation, so the request will go directly to the Action's cancel method. Another entry on the special-case list is the "input" method.
Tip:
The Struts Tags have options and capabilities beyond what we have shown here. For more see, the Struts Tag documentation.
OK, but how do the tags know that both of these fields are required? How do they know what message to display when the fields are empty?
For the answers, we need to look at another flavor of configuration file: the "validation" file.
Login-validation.xml
While it is not hard to code data-entry validation into an Action class, the framework provides an even easier way to validate input.
The validation framework is configured through another XML document, the Login-validation.xml.
Validation file for Login Action
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> <validators> <field name="username"> <field-validator type="requiredstring"> <message key="error.username.required"/> </field-validator> </field> <field name="password"> <field-validator type="requiredstring"> <message key="error.password.required"/> </field-validator> </field> </validators>
You may note that the DTD refers to "XWork". Open Symphony XWork is a generic command-pattern framework that can be used outside of a web environment. Essentially, Struts 2 is a web-based extension of the XWork framework.
The field elements correspond to the ActionForm properties. The username and password field elements say that each field depends on the "requiredstring" validator. If the username is blank or absent, validation will fail and an error message is generated. The messages would be based on the "error.username.required" or "error.password.required" message templates from the resource bundle.
Login Action
If validation passes, the framework invokes the "execute" method of the Login Action. The actual Login Action is brief, since most of the functionality derives from the base class, MailreaderSupport.
Login.java
package mailreader2; import org.apache.struts.apps.mailreader.dao.User; public final class Login extends MailreaderSupport { public String execute() throws ExpiredPasswordException { User user = findUser(getUsername(), getPassword()); if (user != null) { setUser(user); } if (hasErrors()) { return INPUT; } return SUCCESS; } }
Login lays out what we do to authenticate a user. We try to find the user using the credentials provided. If the user is found, we cache a reference. If the user is not found, we return "input" so the client can try again. Otherwise, we return "success", so that the client can access the rest of the application.
MailreaderSupport.java
Let's look at the relevant properties and methods from MailreaderSupport and another base class, ActionSupport, namely "getUsername", "getPassword", "findUser", "setUser", and "hasErrors".
The framework lets you define JavaBean properties directly on the Action. Any JavaBean property can be used, including rich objects. When a request comes in, any public properties on the Action class are matched with the request parameters. When the names match, the request parameter value is set to the JavaBean property. The framework will make its best effort to convert the data, and, if necessary, it will report any conversion errors.
The Username and Password properties are nothing fancy, just standard JavaBean properties.
MailreaderSupport.getUsername() and getPassword()
private String username = null; public String getUsername() { return this.username; } public void setUsername(String username) { this.username = username; } private String password = null; public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; }
We use these properties to capture the client's credentials, and pass them to the more interesting findUser method.
MailreaderSupport.findUser
public User findUser(String username, String password) throws ExpiredPasswordException { User user = getDatabase().findUser(username); if ((user != null) && !user.getPassword().equals(password)) { user = null; } if (user == null) { this.addFieldError("password", getText("error.password.mismatch")); } return user; }
The "findUser" method dips into the MailReader Data Access Object layer, which is represented by the Database property. The code for the DAO layer is maintained as a separate component. The MailReader application imports the DAO JAR, but it is not responsible for maintaining any of the DAO source. Keeping the data access layer at "arms-length" is a very good habit. It encourages a style of development where the data access layer can be tested and developed independently of a specific end-user application. In fact, there are several renditions of the MailReader application, all which share the same MailReader DAO JAR!
Best Practice:
"Strongly separate data access and business logic from the rest of the application."
When "findUser" returns, the Login Action looks to see if a valid (non-null) User object is returned. A valid User is passed to the User property. Although it is still a JavaBean property, the User property is not implemented in quite the same way as Username and Password.
MailreaderSupport.setUser
public User getUser() { return (User) getSession().get(Constants.USER_KEY); } public void setUser(User user) { getSession().put(Constants.USER_KEY, user); }
Instead of using a field to store the property value, "setUser" passes it to a Session property.
MailreaderSupport.getSession() and setSession()
private Map session; public Map getSession() { return session; public void setSession(Map value) { session = value; }
To look at the MailreaderSupport class, you would think the Session property is a plain-old Map. In fact, the Session property is an adapter that is backed by the servlet session object at runtime. The MailreaderSupport class doesn't need to know that though. It can treat Session like any other Map. We can also test the MailreaderSupport class by passing it some other implementation of Map, running the test, and then looking to see what changes MailreaderSupport made to our "mock" Session object.
But, when MailreaderSupport is running inside a web application, how does it acquire a reference to the servlet session?
Good question. If you were to look at just the MailreaderSupport class, you would not see a single line of code that sets the session property. But, yet, when we run the class, the session property is not null. Hmmm.
The magic that provides the Session property a runtime value is called "dependency injection". The MailreaderSupport class implements a interface called SessionAware. SessionAware is bundled with the framework, and it defines a setter for the Session property.
public void setSession(Map session);
Also bundled with the framework is an object called the ServletConfigInterceptor. If the ServletConfigInterceptor sees that an Action implements the SessionAware interface, it automatically set the session property.
if (action instanceof
SessionAware
) { ((SessionAware) action).setSession
(context.getSession()); }The framework uses these "Interceptor" classes to create a front controller for each action an application defines. Each Interceptor can peek at the request before an Action class is invoked, and then again after the Action class is invoked. (If you have worked with Servlet Filters, you will recognize this pattern. But, unlike Filters, Interceptors are not tied to HTTP. Interceptors can be tested and developed outside of a web application.)
You can use the same set of Interceptors for all your actions, or define a special set of Interceptors for any given action, or define different sets of Interceptors to use with different types of actions. The framework comes with a default set of Interceptors, that it will use when another set is not specified, but you can designate your own default Interceptor set (or "stack") in the Struts configuration.
Many Interceptors provide a utility or helper functions, like setting the session property. Others, like the ValidationInterceptor, can change the workflow of an action. Interceptors are key feature of the framework, and we will see a few more on the tour.
If a valid User is not found, or the password doesn't match, the "findUser" method invokes the addFieldError method to note the problem. When "findUser" returns, the Login Action checks for errors, and then it returns either INPUT or SUCCESS.
The "addFieldError" method is provided by the ActionSupport class, which is bundled with the framework. The constants for INPUT and SUCCESS are also provided by ActionSupport. While the ActionSupport class provides many useful utilities, you are not required to use it as a base class. Any Java class can be used as an Action, if you like.
It is a good practice to provide a base class with utilities that can be shared by an application's Action classes. The framework does this with ActionSupport, and the MailReader application does the same with the MailreaderSupport class.
Best Practice:
"Use a base class to define common functionality."
But, what happens if Login returns INPUT instead of SUCCESS. How does the framework know what to do next?
To answer that question, we need to turn back to the Struts configuration and look at how Login is declared.
Login Configuration
The Login action element outlines how the Login workflow operates, including what to do when the Action returns "input", or the default result name "success".
mailreader-support.xml Login
<action name="Login_*" method="{1}" class="mailreader2.Login"> <result name="input">/pages/Login.jsp</result> <result name="cancel" type="redirect-action">Welcome</result> <result type="redirect-action">MainMenu</result> <result name="expired" type="chain">ChangePassword</result> <exception-mapping exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException" result="expired"/> <interceptor-ref name="guest"/> </action>
You might notice that the name of the Login action element is not "Login" but "Login_*". The asterisk is a special "wildcard" notation that tells the framework to match any series of character at this point. In the method attribute, the "{1}" notation indicates that framework should substitute whatever characters match the asterisk at runtime. When we cite actions like "Login_cancel" or "Login_input", the framework matches "cancel" or "input" with the wildcard and fills in the blanks.
The "trailing bang" notation was hardwired into WebWork 2. To provide backward compatibility, the notation is supported by Struts 2.0. If you prefer to use wildcards to emulate the same notation, as the Mailreader does, you should disable the old notation in the Struts properties file.
struts.properties
struts.enable.DynamicMethodInvocation = false
Using wildcards with a exclamation point (or "bang") is not the only way we can use wilcards to invoke methods. If we wanted to use actions like "inputLogin", we could move the asterisk and use an action name like "*Login".
Within the Login action element, the first result element is named "input". If validation or authentification fail, the Action class will return "input" and the framework will transfer control to the "Login.jsp" page.
The second result element is named cancel. If someone presses the cancel button on the Login page, the Action class will return "cancel", this result will be selected, and the framework will issue a redirect to the Welcome action.
The third result has no name, so it will be called if the default success token is returned. So, if the Login succeeds, control will transfer to the MainMenu action.
The MailReader DAO exposes a "ExpiredPasswordException". If the DAO throws this exception when the User logs in, the framework will process the exception-mapping and transfer control to the "ChangePassword" action.
Just in case any other Exceptions are thrown, the MailReader application also defines a global handler.
mailreader-default.xml exception-mapping
<global-exception-mappings> <exception-mapping result="error" exception="java.lang.Exception"/> </global-exception-mappings>
If an unexpected Exception is thrown, the exception-mapping will transfer control to the action's "error" result, or to a global "error" result. The MailReader defines a global "error" result which transfers control to an "Error.jsp" page that can display the error message.
Error.jsp
<%@ page contentType="text/html; charset=UTF-8" %> <%@ taglib prefix="s" uri="http://struts.apache.org/tags" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   <title>Unexpected Error</title>
An unexpected error has occured

 Please report this error to your system administrator or appropriate technical support personnel. Thank you for your cooperation.

Error Message
 <s:actionerror />
 <s:property value="%{exception.message}"/>

Technical Details

 <s:property value="%{exceptionStack}"/>
 <jsp:include page="Footer.jsp"/>
The Error page uses property tags to expose the Exception message and the Exception stack.
Finally, the Login action specifies an InterceptorStack named defaultStack. If you've worked with Struts 2 or WebWork 2 before, that might seem strange, since "defaultStack" is the factory default.
In the MailReader application, most of the actions are only available to authenticated users. The exceptions are the Welcome, Login, and Register actions which are available to everyone. To authenticate clients, the MailReader uses a custom Interceptor and a custom Interceptor stack.
org.apache.struts.examples.mailreader2.AuthenticationInterceptor
package mailreader2; import com.opensymphony.xwork2.interceptor.Interceptor; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.Action; import java.util.Map; import org.apache.struts.apps.mailreader.dao.User; public class AuthenticationInterceptor implements Interceptor { public void destroy () {} public void init() {} public String intercept(ActionInvocation actionInvocation) throws Exception { Map session = actionInvocation.getInvocationContext().getSession(); User user = (User) session.get(Constants.USER_KEY); boolean isAuthenticated = (null!=user) && (null!=user.getDatabase()); if (isAuthenticated) { return actionInvocation.invoke(); } else { return Action.LOGIN; } } }
The AuthenticationInterceptor looks to see if a User object has been stored in the client's session state. If so, it returns normally, and the next Interceptor in the set would be invoked. If the User object is missing, the Interceptors returns "login". The framework would match "login" to the global result, and transfer control to the Login action.
The MailReader defines three custom Interceptor stacks: "user", "user-submit", and "guest".
mailreader-default.xml interceptors
<interceptors> <interceptor name="authentication" class="mailreader2.AuthenticationInterceptor"/> <interceptor-stack name="user" > <interceptor-ref name="authentication" /> <interceptor-ref name="defaultStack"/> </interceptor-stack> <interceptor-stack name="user-submit" > <interceptor-ref name="tokenSession" /> <interceptor-ref name="user"/> </interceptor-stack> <interceptor-stack name="guest" > <interceptor-ref name="defaultStack"/> </interceptor-stack> </interceptors> <default-interceptor-ref name="user"/>
The user stacks require that the client be authenticated. In other words, that a User object is present in the session. The actions using a guest stack can be accessed by any client. The -submit versions of each can be used with actions with forms, to guard against double submits.
Double Submits
A common problem with designing web applications is that users are impatient and response times can vary. Sometimes, people will press a submit button a second time. When this happens, the browser submits the request again, so that we now have two requests for the same thing. In the case of registering a user, if someone does press the submit button again, and their timing is bad, it could result in the system reporting that the username has already been used. (The first time the button was pressed.) In practice, this would probably never happen, but for a longer running process, like checking out a shopping cart, it's easier for a double submit to occur.
To forestall double submits, and "back button" resubmits, the framework can generate a token that is embedded in the form and also kept in the session. If the value of the tokens do not compare, then we know that there has been a problem, and that a form has been submitted twice or out of sequence.
The Token Session Interceptor will also attempt to provide intelligent fail-over in the event of multiple requests using the same session. That is, it will block subsequent requests until the first request is complete, and then instead of returning the "invalid.token" code, it will attempt to display the same response that the original, valid action invocation would have displayed
Because the default interceptor stack will now authenticate the client, we need to specify the standard "defaultStack" for the three "guest actions", Welcome, Login, and Register. Requiring authentification by default is the better practice, since it means that we won't forget to enable it when creating new actions. Meanwhile, those pesky users will ensure that we don't forget to disable authentification for "guest" services.
MainMenu
On a successful login, the Main Menu page displays. If you logged in using the demo account, the page title should be "Main Menu Options for John Q. User". Below this legend should be two links:
- Edit your user registration profile
- Log off MailReader Demonstration Application
Let's review the source for the "MainMenu" action mapping, and the "MainMenu.jsp".
Action mapping element for MainMenu
<action name="MainMenu" class="org.apache.struts.examples.mailreader2.MailreaderSupport"> <result>/pages/MainMenu.jsp</result> </action>
MainMenu.jsp
<%@ page contentType="text/html; charset=UTF-8" %> <%@ taglib prefix="s" uri="http://struts.apache.org/tags" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   <title><s:text name="mainMenu.title"/></title> <link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet" type="text/css"/>
<s:text name="mainMenu.heading"/> <s:property value="user.fullName"/>

<a href="<s:url action="Registration_input" />"> <s:text name="mainMenu.registration"/>

<a href="<s:url action="Logout" />"> <s:text name="mainMenu.logout"/>

The source for "MainMenu.jsp" also contains a new tag, property, which we use to customize the page with the "fullName" property of the authenticated user.
Displaying the user's full name is the reason the MainMenu action references the MailreaderSupport class. The MailreaderSupport class has a User property that the text tag can access. If we did not utilize MailreaderSupport, the property tag would not be able to find the User object to print the full name.
The customized MainMenu page offers two standard links. One is to "Edit your user registration profile". The other is to "Logout the MailReader Demonstration Application".
Registration page
If you follow the "Edit your user registration profile" link from the Main Menu page, we will finally reach the heart of the MailReader application: the Registration, or "Profile", page. This page displays everything MailReader knows about you (or at least your login), while utilizing several interesting techniques.
To do double duty as the "Create" Registration page and the "Edit" Registration page, the "Registration.jsp" makes extensive use of the test tags, to make it appears as though there are two distinct pages.
Registration.jsp - head element
 <s:if test="task=='Create'"> <title><s:text name="registration.title.create"/></title> </s:if> <s:if test="task=='Edit'"> <title><s:text name="registration.title.edit"/></title> </s:if> <link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet" type="text/css"/>
For example, if client is editing the form (task == 'Edit'), the page inserts the username from the User object. For a new Registration (task == 'Create'), the page creates an empty data-entry field.
Note:
Presention Logic - The "test" tag is a convenient way to express presentation logic within your pages. Customized pages help to prevent user error, and dynamic customization reduces the number of server pages your application needs to maintain, among other benefits.
The page also uses logic tags to display a list of subscriptions for the given user. If the RegistrationForm has task set to "Edit", the lower part of the page that lists the subscriptions is exposed.
<s:if test="task == 'Edit'">

<s:text name="heading.subscriptions"/>

  </s:if> <jsp:include page="Footer.jsp"/>
Otherwise, the page contains just the top portion -- a data-entry form for managing the user's registration.
iterator
Besides "if" there are several other control tags that you can use to sort, filter, or iterate over data. The Registration page includes a good example of using the iterator tag to display the User's Subscriptions.
The subscriptions are stored in a hashtable object, which is in turn stored in the user object. So to display each subscription, we have to reach into the user object, and loop through the members of the subscription collection. Using the iterator tag, you can code it the way it sounds.
Using iterator to list the Subscriptions
<s:iterator value="user.subscriptions">
  <s:property value="host"/> 	  <s:property value="username"/> 	  <s:property value="type"/> 	  <s:property value="autoConnect"/> 	  <a href="<s:url action="Subscription_delete"><s:param name="host" value="host"/></s:url>"> <s:text name="registration.deleteSubscription"/>  <a href="<s:url action="Subscription_edit"><s:param name="host" value="host"/></s:url>"> <s:text name="registration.editSubscription"/>
 </s:iterator>
When the iterator renders, it generates a list of Subscriptions for the current User.
Current Subscriptions
Add
Host Name User Name Server Type Auto Action mail.hotmail.com user1234 pop3 false Delete Edit mail.yahoo.com jquser imap false Delete Edit
Now look back at the code used to generate this block.
Notice anything nifty?
How about that the markup between the iterator tag is actually simpler than the markup that we would use to render one row of the table?
Instead of using a qualified reference like "value=user.subscription[0].host", we use the simplest possible reference: "value=host". We didn't have to define a local variable, and reference that local in the loop code. The reference to each item in the list is automatically resolved, no fuss, no muss.
Nice trick!
The secret to this magic is the value stack. Next to Interceptors, the value stack is probably the coolest thing there is about the framework. To explain the value stack, let's step back and start from the beginning.
Merging dynamic data into static web pages is a primary reason we create web applications. The Java API has a mechanism that allows you to place objects in a servlet scope (page, request, session, or application), and then retrieve them using a JSP scriplet. If the object is placed directly in one of the scopes, a JSP tag or scriptlet can find that object by searching page scope and then request scope, and session scope, and finally application scope.
The value stack works much the same way, only better. When you push an object on the value stack, the public properties of that object become first-class properties of the stack. The object's properties become the stack's properties. If another object on the stack has properties of the same name, the last object pushed onto the stack wins. (Last-In, First-Out.)
When the iterator tag loops through a collection, it pushes each item in the collection onto the stack. The item's properties become the stack's property. In the case of the Subscriptions, if the Subscription has a public Host property, then during that iteration, the stack can access the same property.
Of course, at the end of each iteration, the tag "pops" the item off the stack. If we were to try and access the Host property later in the page, it won't be there.
When an Action is invoked, the Action class is pushed onto the value stack. Since the Action is on the value stack, our tags can access any property of the Action as if it were an implicit property of the page. The tags don't access the Action directly. If a textfield tag is told to render the "Username" property, the tag asks the value stack for the value of "Username", and the value stack returns the first property it finds by that name, on any object on the stack.
The Validators also use the stack. When validation fails on a field, the value for the field is pushed onto the value stack. As a result, if the client enters text into an Integer field, the framework can still redisplay whatever was entered. An invalid input value is not stored in the field (even if it could be). The invalid input is pushed onto the stack for the scope of the request.
The Subscription list uses another new tag: the param tag. As tags go, "param" takes very few parameters of its own: just "name" and "value", and neither is required. Although simple, "param" is one of the most powerful tags the framework provides. Not so much because of what it does, but because of what "param" allows the other tags to do.
Essentially, the "param" tag provides parameters to other tags. A tag like "text" might be retrieving a message template with several replaceable parameters. No matter how many parameters are in the template, and no matter what they are named, you can use the "param" tag to pass in whatever you need.
pager.legend = Displaying {current} of {count} items matching {criteria}. ... <s:text name="pager.legend"> <s:param name="current" value="42" /> <s:param name="count" value="314" /> <s:param name="criteria" value="Life, the Universe, and Everything" /> </s:text>
In the case of an "url" tag, we can use "param" to create the query string. A statement like this:
<s:url action="Subscription_edit"><s:param name="host" value="host"/></s:url>">
can render a hyperlink like this:
Edit
If a hyperlink needs more parameters, you can use "param" to add as many parameters as needed.
Subscription
If we follow one of the "Edit" subscription links on the Registration page, we come to the Subscriptions page, which displays the details of our description in a data-entry form. Let's have a look at the Subscription configuration and follow the bouncing ball from page to action to page.
mailreader-support.xml Subscription element
<action name="Subscription_*" method="{1}" class="org.apache.struts.examples.mailreader2.Subscription"> <result name="input">/pages/Subscription.jsp</result> <result type="redirect-action">Registration_input</result> </action>
The Edit link specified the Subscription action, but also includes the qualifier _edit. The wildcard notation tells the framework to use any characters given after "Subscription_" as the name of a method to invoke on the Action class, instead of the default execute method. The "alternate" execute methods are called alias methods.
Subscription edit alias
public String edit() { setTask(Constants.EDIT);> return find(); } public String find() { org.apache.struts.apps.mailreader.dao.Subscription sub = findSubscription(); if (sub == null) { return ERROR; } setSubscription(sub); return INPUT; }
The "edit" alias has two responsibilities. First, it must set the Task property to "Edit". The Subscription page will render itself differently depending on the value of the Task property. Second, "edit" must locate the relevant Subscription and set it to the Subscription property. If all goes well, "edit" returns the INPUT token, so that the "input" result will be invoked.
In the normal course, the Subscription should always be found, since we selected the entry from a system-generated list. If the Subscription is not found, it would be because the database disappeared or the request is being spoofed. If the Subscription is not found, edit returns the token for the global "error" result, because this condition is unexpected.
The business logic for the "edit" alias is a simple wrapper around the MailReader DAO classes.
MailreaderSupport findSubscription()
public Subscription findSubscription() { return findSubscription(getHost()); } public Subscription findSubscription(String host) { Subscription subscription; subscription = getUser().findSubscription(host); return subscription; }
This code is very simple and doesn't seem to provide much in the way of error handling. But, that's OK. Since the page is suppose to be entered from a link that we created, we do expect everything to go right here. But, if it doesn't, the global exception handler we defined in the MailReader configuration will trap the exception for us.
Likewise, the AuthentificationInterceptor will ensure that only clients with a valid User object can try to edit a Subscription. If the session expired, or someone bookmarked the page, the client will be redirected to the Login page automatically.
As a final layer of defense, we also configured a validator for Subscription, to ensure that we are passed a Host parameter.
Subscription-validation.xml
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> <validators> <field name="host"> <field-validator type="requiredstring"> <message key="error.host.required"/> </field-validator> </field> </validators>
By keeping routine safety precautions out of the Action class, the all-important Action becomes smaller and easier to maintain.
After setting the relevent Subscription object to the Subscription property, the framework transfers control to the (you guessed it) Subscription page.
Subscription.jsp
<%@ page contentType="text/html; charset=UTF-8" %> <%@ taglib prefix="s" uri="http://struts.apache.org/tags" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   <s:if test="task=='Create'"> <title><s:text name="subscription.title.create"/></title> </s:if> <s:if test="task=='Edit'"> <title><s:text name="subscription.title.edit"/></title> </s:if> <s:if test="task=='Delete'"> <title><s:text name="subscription.title.delete"/></title> </s:if> <link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet" type="text/css"/>   <s:actionerror/> <s:form action="Subscription_save" validate="true"> <s:token /> <s:hidden name="task"/> <s:label key="username" name="user.username"/> <s:if test="task == 'Create'"> <s:textfield key="mailHostname" name="host"/> </s:if> <s:else> <s:label key="mailHostname" name="host"/> <s:hidden name="host"/> </s:else> <s:if test="task == 'Delete'"> <s:label key="subscription.username"/> <s:label key="subscription.password"/> <s:label key="subscription.type"/> <s:label key="subscription.autoConnect"/> <s:submit key="button.confirm"/> </s:if> <s:else> <s:textfield key="subscription.username"/> <s:textfield key="subscription.password"/> <s:select key="subscription.type" list="types"/> <s:checkbox key="subscription.autoConnect"/> <s:submit key="button.save"/> <s:reset key="button.reset"/> </s:else> <s:submit action="Registration_input" key="button.cancel" onclick="form.onsubmit=null"/> </s:form> <jsp:include page="Footer.jsp"/>
As before, we'll discuss the tags and attributes that are new to this page: "token", "hidden", "label", "select", and "checkbox".
The token tag works with the Token Session Interceptor to foil double submits. The tag generates a key that is embedded in the form and cached in the session. Without this tag, the Interceptor can't work it's magic.
The hidden tag embeds the Task property into the form. When the form is submitted, the Subscription_save action will use the Task property to decide whether to insert or update the form.
The label renders a "read only" version of a property, suitable for placement in the form. In Edit or Delete mode, we want the Host property to be immutable, since it is used as a key. (As unwise as that might sound.) In Delete mode, all of the properties are immutable, since we are simply confirming the delete operation.
Saving the best for last, the Subscription form utilizes two more interesting tags, "select" and "checkbox".
Unsurprisingly, the select tag renders a select control, but the tag does so without requiring a lot of markup or redtape.
<s:select key="subscription.type" list="types" />
The interesting attribute of the "select" tag is "list", which, in our case, specifies a value of "types". If we take another look at the Subscription action, we can see that it implements an interface named Preparable and populates a Types property in a method named "prepare".
Subscription-validation.xml
public class Subscription extends MailreaderSupport implements Preparable { private Map types = null; public Map getTypes() { return types; } public void prepare() { Map m = new LinkedHashMap(); m.put("imap", "IMAP Protocol"); m.put("pop3", "POP3 Protocol"); types = m; setHost(getSubscriptionHost()); } // ...
The default Interceptor stack includes the PrepareInterceptor, which observes the Preparable interface.
PrepareInterceptor
public class PrepareInterceptor extends AroundInterceptor { protected void after(ActionInvocation dispatcher, String result) throws Exception { } protected void before(ActionInvocation invocation) throws Exception { Object action = invocation.getAction(); if (action instanceof Preparable) { ((Preparable) action).prepare(); } } }
The PrepareInterceptor ensures that the "prepare" method will always be called before "execute" or an alias method is invoked. We use "prepare" to setup the list of items for the select list to display. We also transfer the Host property from our Subscription object to a local property, where it is easier to manage.
Subscription.java
Like many applications, the MailReader uses mainly String properties. One exception is the AutoConnect property of the Subscription object. On the HTML form, the AutoConnect property is represented by a checkbox.
When writing web applications, the checkbox can be a tricky control. The Subscription object has a boolean AutoConnect property, and the checkbox simply has to represent its state. The problem is, if you clear a checkbox, the browser client will not submit anything. Nada. Zip. It is as if the checkbox control never existed. The HTTP protocol has no way to affirm "false". If the control is missing, we need to figure out it's been unclicked.
In Struts 1, we use the
reset
method to work around checkbox issues. In Struts 2, checkbox state is handled automatically. The framework can detect when a checkbox tag has not been sent back, and when that happens, a default "false" value is used for the checkbox value. No worries, mate.If we press the SAVE button, the form will be submitted to the Subscription_save action. Since the save method needs some additional validation, we can add a validation file.
Subscription-Subscription_save-validation.xml
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> <validators> <field name="host"> <field-validator type="requiredstring"> <message key="error.host.required"/> </field-validator> </field> </validators>
The validators follow the same type of inheritance path as the classes. SubscriptionSave extends Subscription, so when Subscription_save is validated, the Host property specified by "Subscription-validation.xml" will also be required.
If validation succeeds, the
save
method of Subscription will fire.
Subscription
public String save() throws Exception { if (Constants.DELETE.equals(getTask())) { removeSubscription(); } if (Constants.CREATE.equals(getTask())) { copySubscription(getHost()); } saveUser(); return SUCCESS; }
The save method uses the Task property to handle the special cases of deleting and creating, and then updates the state of the User object.
The removeSubscription method calls the DAO facade, and then updates the application state.
removeSubscription
public void removeSubscription() throws Exception { getUser().removeSubscription(getSubscription()); getSession().remove(Constants.SUBSCRIPTION_KEY); }
The copySubscription method is a bit more interesting. The MailReader DAO layer API includes some immutable fields that can't be set once the object is created. Because key fields are immutable, we can't just create a Subscription, let the framework populate all the fields, and then save it when we are done -- because some fields can't be populated, except at construction.
One workaround would be to declare properties on the Action for all the properties we need to pass to the Subscription or User objects. When we are ready to create the object, we could pass the new object values from the Action properties.
Another workaround is to declare only the immutable properties on the Action, and then use what we can from the domain object.
This implementation of the MailReader utilizes the second alternative. We define User and Subscription objects on our base Action, and add other properties only as needed.
To add a new Subscription or User, we create a blank object to capture whatever fields we can. When this "input" object returns, we create a new object, setting the immutable fields to appropriate values, and copy over the rest of the properties.
copySubscription
public void copySubscription(String host) { Subscription input = getSubscription(); Subscription sub = createSubscription(host); if (null != sub) { BeanUtils.setValues(sub, input, null); setSubscription(sub); setHost(sub.getHost()); } }
Of course, this is not a preferred solution, but merely a way to work around an issue in the MailReader DAO API that would not be easy for us change.
Subscription Submit
When we pressed the SAVE button, there was one step that we overlooked. The Mailreader application uses a "double submit" guard to keep people from clicking the SAVE button multiple times and submitting the form again.
To add the double-submit guard, we can change the actions default processing stack to
user-submit
. But, we don't want to just copy and paste the other action settings from the main Subscription action. What we can do is put the subscription actions in their own package, so that they can share result types.
mailreader-support.xml
</package> <package name="subscription" namespace="/" extends="mailreader-support"> <global-results> <result name="input">/Subscription.jsp</result> <result type="redirect-action">Registration_input</result> </global-results> <action name="Subscription_save" method="save" class="org.apache.struts.examples.mailreader2.Subscription"> <interceptor-ref name="user-submit" /> </action> <action name="Subscription_*" method="{1}" class="org.apache.struts.examples.mailreader2.Subscription" /> </package> <package name="wildcard" namespace="/" extends="mailreader-support"> <action name="*" class="org.apache.struts.examples.mailreader2.MailreaderSupport"> <result>/{1}.jsp</result> </action> </package> }
Aftering a successful save, the Subscription Action will return "success", and the framework will redirect us back to Registration input.
Summary
At this point, we've booted the application, logged on, reviewed a Registration record, and edited a Subscription. Of course, there's more, but from here on, it is mostly more of the same. The full source code for MailReader is available online and in the distribution.
Enjoy!


Is a group of related varieties of Chinese spoken across most of northern and southwestern China. The group includes the Beijing dialect, the basis of Standard Chinese, which is also referred to as "Mandarin". Because most Mandarin dialects are found in the north, the group is sometimes referred to as the Northern dialects (北方话; běifānghuà). Many local Mandarin varieties are not mutually intelligible. Nevertheless, Mandarin is often placed first in any list of languages by number of native speakers.
Is a Romance language that originated in the Castile region of Spain and today has hundreds of millions of native-speakers across the world.
The English language is the primary language of several countries (including Australia, Canada, New Zealand, the United Kingdom, and the United States) and a second language in a number of multilingual countries (including India, Singapore, and the Philippines).
Modern Standard Hindi (Hindi: मानक हिन्दी mānak hindī) or simply Hindi (Hindi: हिन्दी hindī), is a standardised and Sanskritised register of the Hindustani language. Hindi is one of the official languages of the Union of India, and the lingua franca of the Hindi belt languages.
(Arabic: العَرَبِيَّة, Al-ʻarabiyyah [ʔalʕaraˈbijːah] or Arabic: عَرَبِيّ ʻarabiyy [ʕaraˈbijː]) is a Central Semitic language that was first spoken in Iron Age northwestern Arabia and is now the lingua franca of the Arab world. It named after the Arabs, a term initially used to to describe peoples living from Mesopotamia in the east to the Anti-Lebanon mountains in the west, and from northwestern Arabia to the Sinai in the south.
(português or, in full, língua portuguesa) is a Romance language and the sole official language of Angola, Brazil, Cape Verde, Guinea-Bissau, Mozambique, Portugal, and São Tomé and Príncipe. It also has co-official language status in East Timor, Equatorial Guinea and Macau. As the result of expansion during colonial times, a cultural presence of Portuguese and Portuguese creole speakers are also found in Goa, Daman and Diu in India; in Batticaloa on the east coast of Sri Lanka; in the Indonesian island of Flores; and in Malacca in Malaysia.
(/bɛŋˈɡɔːli/), also known by its endonym Bangla (/bɑːŋlɑː/; বাংলা [ˈbaŋla] ( listen)), is an Indo-Aryan language spoken in South Asia. It is the national and official language of the People's Republic of Bangladesh, and official language of several northeastern states of the Republic of India, including West Bengal, Tripura, Assam (Barak Valley) and Andaman and Nicobar Islands.
(ру́сский язы́к, russkij jazyk, pronounced [ˈruskʲɪj jɪˈzɨk]) is an East Slavic language and an official language in Russia, Belarus, Kazakhstan, Kyrgyzstan and many minor or unrecognised territories. It is an unofficial but widely spoken language in Ukraine, Latvia, Estonia, and to a lesser extent, the other countries that were once constituent republics of the Soviet Union and former participants of the Eastern Bloc. Russian belongs to the family of Indo-European languages and is one of the three living members of the East Slavic languages. Written examples of Old East Slavonic are attested from the 10th century and beyond.
(日本語 Nihongo?, [nihõŋɡo] or [nihõŋŋo]) is an East Asian language spoken by about 125 million speakers, primarily in Japan, where it is the national language. It is a member of the Japonic (or Japanese-Ryukyuan) language family, whose relation to other language groups, particularly to Korean and the suggested Altaic language family, is debated.
(Shahmukhi: پنجابی paṉjābī; Gurmukhi: ਪੰਜਾਬੀ pañjābī) is an Indo-Aryan language spoken by over 100 million native speakers worldwide, making it the 10th most widely spoken language (2015) in the world. It is the native language of the Punjabi people who inhabit the historical Punjab region of Pakistan and India. It is the only living language among the Indo-European languages which is a fully tonal language.


Mission to Mars
A Postview, copyright 2000 by Paul-Michael Agapow.
"Mission to Mars" Released 2000. Directed by Brian De Palma. Starring Gary Sinise, Tim Robbins, Don Cheadle and (very briefly) Kim Delaney.
A heroic crew struggles to rescue a team of astronauts stranded on Mars, stopping only for product placement and triumphant fanfares.
It has become traditional with every new Brian De Palma film to tut-tut about how it's not up to his usual standard. Which brings to mind the question: Exactly what is De Palma's usual standard? "Snake Eyes"? "Bonfire of the Vanities"?
The setup is this: the year is 2020 and Earth is going to Mars. Of course, when I say "Earth" I mean "America", just like when the film says "international effort", they mean "NASA". Now, Ray Bradbury wrote about the small-town America going to Mars, with colonists building homesteads and sitting on their front porches sipping lemonade.  (I say "baby boomers" but the characters are of course 30 years too young for the way they dress, talk and the music they listen to. I say "laddish" but there are three female characters: one whose main function is to fret, one that dies twenty minutes into the film and another who dies before the film even starts.) What we have here is "2001" as done by Ron Howard. Note: this is not a compliment.
But anyway, Earth is going to Mars. Unfortunately (for the audience) the first expedition is composed of Z-list actors and is thus doomed to be wiped out by a mysterious alien artefact. (Don't you hate it when that happens?) So a rescue mission is mounted DR PEPPER and is entering Martian KAWASAKI orbit when disaster PENZOIL strikes and their M&MS ship is BUDWEISER struck by SONY meteorites. BUY MORE STUFF. "Put on your helmet or you'll embolize!", worries the femme-astronaut. At first I thought it was a warning to the audience, but it turns out the ship is in danger and mission commander Tim Robbins is making his big bid to escape the script. (The plucky little guy looked kinda peaceful at the end, a happy little smile on his face as he froze to death.) The chick panics for a while, they make a crash-landing on Mars and find the lone survivor. ("Hey, we're the rescue team! Uh, you wouldn't have a spare spaceship lying around would you?")
As bogus as the first part of the film is, it at least shows some grip of orbit al mechanics and physics. By contrast, the biology appears to have been lifted from "Pokemon". You see, the aliens have left a secret message for humans, a message that may only be decoded by someone who has seen "Contact". The message turns out to be a DNA sequence that is "missing a chromosome". (Two possibilities: 1. No-one on the team knows anything about biology, or 2. The astronauts' confusion over basic molecular biology is due to NASA's affirmative action policy on hiring the chromosomally challenged.) The astronautrix panics for a while, then concludes that if they fill in the "missing chromosome", the mysterious alien artefact will usher the astronauts into a really cool planetarium. This happens. (Although surely it would have been a lot simpler and cheaper for NASA to just send the guys to the Field Museum for the afternoon.)
The basic goofiness of "Mission to Mars" is compounded by lugheaded dialogue and direction, with characters explaining what they have just done or are just about to do, and computers helpfully announcing "AT POINT OF NO RETURN" or "AIR LEVELS FALLING TO 30 PERCENT". Note please this is a film that has three names credited for the "story" and three more for the "screenplay". This smacks of writers who did all their research by watching other movies - "Contact", "The Abyss", "Apollo 13", "Close Encounters", "2001", "Silent Running" - while watching the Discovery Channel for flavour. Add in the strident soundtrack and gobs of pseudoscience and you have a very unhappy audience.
  It makes one yearn for the intellectual thrust and parry of Starship Troopers. [*/misfire] and that long empty stretch of road north of Port Augusta on the Sid & Nancy scale.
-- Paul-Michael Agapow<EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Ocala events
-
does peppermint extract repel flies
Sheboygan Newspapers | Newspapers in Sheboygan, WI - YP.com
9 listings of Newspapers in Sheboygan on YP.com. Find reviews, directions & phone numbers for the best newspapers in Sheboygan, WI.
http://www.yellowpages.com/sheboygan-wi/newspapers5 Newspapers from Sheboygan WI and Neighboring Towns ...
Sheboygan Newspaper List - Read online versions of Sheboygan WI Newspapers.
http://www.allyoucanread.com/sheboygan-newspaper-wi/Sheboygan Sun - Sheboygan, WI - Newspaper | Facebook
Sheboygan Sun, Sheboygan, WI. 12 likes · 0 talking about this.
http://www.facebook.com/pages/Sheboygan-Sun/134597196583064Sheboygan Press Newspaper from Sheboygan, Wisconsin (WI),
Click here for today's Sheboygan Press newspaper from Sheboygan, Wisconsin, .
http://www.thepaperboy.com/newspaper.cfm?PaperID=-61941801
noz to noz x series kennels Upcoming events in Ocala
- Sponsored event
silence of the lambs sociological perspectives
Apr 6 - Downtown Disney
high general aviation fuel prices jeanette ashman powhatan va
congress and toxicology and meeting Hottest Tickets
-
Apr 112 girls 1 cup free online
Amway Center -
Apr 28matt kates delloite and touches
Amway Center -
Jun 25restaurant zea new orleans
Bob Carr Performing Arts Center -
Mar 30deep creek lake fishing map
Amway Center -
Aug 27radeon hd2400 pro driver
Amway Center -
Jun 21how to make a psychogram
Amway Center -
Sep 13paradise park leessummit mo
Francis Field -
Mar 17best chicken fried chicken in houston
St Augustine Amphitheatre -
Oct 8p i mortgage calculator
Amway Center -
May 4penny pack nursing home
Bob Carr Performing Arts Center
Ocala's best venues
-
Only in Sheboygan, Wisconsin: The Weird, Wacky and Quirky ...
Mar 17, 2011 . Here is the list from, counting down to the top odd news of the year for Sheboygan. . Only in Sheboygan, Wisconsin: The Weird, Wacky and Quirky . to do with writing or grammar, including the newspaper and yearbook.
http://voices.yahoo.com/only-sheboygan-wisconsin-weird-wacky-quirky-8080340.html -
Eric Litke | LinkedIn
Investigative Reporter at Gannett Wisconsin Media . January 2012 Present (1 year 3 months) Sheboygan, WI . Wisconsin Newspaper Association Awards: .
http://www.linkedin.com/in/ericlitke -
Sheboygan, WI Classifieds | Local Classified Ads | Oodle
Browse Oodle Sheboygan, WI classifieds to find everything you need. . No need for you to search in newspapers and disorganized classified sites, Oodle has .
http://www.oodle.com/regions/sheboygan/caravan journey to the lyric
98 people's favorite
-
Sheboygan Press - Wisconsin Local History and Biography Articles
157 records . You Searched For: Newspaper = 'Sheboygan Press' .
http://www.wisconsinhistory.org/wlhba/searchResults.asp?adv=yes&np=Sheboygan+Press -
Plymouth Review: Home | www.plymouth-review.com
1 day ago . For local news delivered via email enter address here: . Sheboygan Falls celebrates its beginnings with the Cole Historic District (cover), just .
http://www.plymouth-review.com/


An enhanced HTML 5 file input for Bootstrap 3.x with file preview for various files, offers multiple selection, and more. The plugin allows you a simple way to setup an advanced file picker/upload control built to work specially with Bootstrap CSS3 styles. It enhances the file input functionality further, by offering support to preview a wide variety of files i.e. images, text, html, video, audio, flash, and objects. In addition, it includes AJAX based uploads, dragging & dropping files, viewing upload progress, and selectively previewing, adding, or deleting files.
NOTE: An alternative new Krajee Explorer Theme (preview shown below) for
bootstrap-fileinput
has been released and available since v4.3.7. For more theming options and suggestions refer the theming demos.
View the plugin documentation and plugin demos at Krajee JQuery plugins.
NOTE: - The latest version of the plugin is v4.4.3 (under development). Refer the CHANGE LOG for details. - You can use the sass branch for installation using
bootstrap-sass
dependency. The master branch can be used for installation using plainbootstrap
dependency.
You can use the bower
package manager to install. Run:
bower install bootstrap-fileinput
You can use the composer
package manager to install. Either run:
$ php composer.phar require kartik-v/bootstrap-fileinput "@dev"
or add:
"kartik-v/bootstrap-fileinput": "@dev"
to your composer.json file
You can also manually install the plugin easily to your project. Just download the source ZIP or TAR ball and extract the plugin assets (css and js folders) into your project.
Step 1: Load the following assets in your header.
html
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="path/to/css/fileinput.min.css" media="all" rel="stylesheet" type="text/css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- piexif.min.js is only needed if you wish to resize images before upload to restore exif data.
This must be loaded before fileinput.min.js -->
<script src="path/to/js/plugins/piexif.min.js" type="text/javascript"></script>
<!-- sortable.min.js is only needed if you wish to sort / rearrange files in initial preview.
This must be loaded before fileinput.min.js -->
<script src="path/to/js/plugins/sortable.min.js" type="text/javascript"></script>
<!-- purify.min.js is only needed if you wish to purify HTML content in your preview for HTML files.
This must be loaded before fileinput.min.js -->
<script src="path/to/js/plugins/purify.min.js" type="text/javascript"></script>
<!-- the main fileinput plugin file -->
<script src="path/to/js/fileinput.min.js"></script>
<!-- bootstrap.js below is needed if you wish to zoom and view file content
in a larger detailed modal dialog -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
<!-- optionally if you need a theme like font awesome theme you can include
it as mentioned below -->
<script src="path/to/themes/fa/theme.js"></script>
<!-- optionally if you need translation for your language then include
locale file as mentioned below -->
<script src="path/to/js/locales/<lang>.js"></script>
If you noticed, you need to load the jquery.min.js
and bootstrap.min.css
in addition to the fileinput.min.css
and fileinput.min.js
. The theme file themes/fa/theme.js
can be optionally included for the font awesome icons styling. The locale file <lang>.js
can be optionally included for translating for your language if needed.
Optional Dependent Plugins
piexif.min.js
file is the source for the Piexifjs plugin by hMatoba. It is required to be loaded before fileinput.min.js
if you wish to use the image resize feature of the bootstrap-fileinput plugin. sortable.min.js
file is the source for the Sortable plugin by rubaxa. It is required to be loaded before fileinput.min.js
if you wish to sort the thumbnails in the initial preview.purify.min.js
file is the source for the DomPurify plugin by cure53. It is required to be loaded before fileinput.min.js
if you wish to purify your HTML for HTML content preview.For ease of access, the sources for the above plugins are included in the js/plugins
folder of this project repository.
Step 2: Initialize the plugin on your page. For example,
```js // initialize with defaults $("#input-id").fileinput();
// with plugin options $("#input-id").fileinput({'showUpload':false, 'previewFileType':'any'}); ```
The #input-id
is the identifier for the input (e.g. type = file
) on your page, which is hidden automatically by the plugin.
Alternatively, you can directly call the plugin options by setting data attributes to your input field.
html
<input id="input-id" type="file" class="file" data-preview-file-type="text" >
bootstrap-fileinput is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.


AngularJS is a toolset for building the framework most suited to your application development.
Spectacular Test Runner for JavaScript.
Jasmine is a behavior-driven development framework for testing JavaScript code.


Home
Projects
Games
Data Visualization
Data Visualization
US GDP
US Higher Education
US Heat Map
US Movie Grosses
Doping in Professional Cycling
Penguin


Eamples uses of stripe payments
Single Payment
{{> purchase}}
recurring payment
{{> recurringPayments}}


| Program: |
GVT |
| Category: |
Hypertrophy |
| Period: |
01.06.18 - 31.07.18 |
|
| TEST EXERCISE: |
PRE TEST (1RM): |
POSTEST (1RM): |
RESULTS (% INCREASE): |
PRETEST (LEVEL): |
POSTTEST (LEVEL): |
| Bench Press |
100 |
108 |
8,00% |
Intermediate |
Intermediate |
| Squat |
140 |
145 |
3,57% |
intermediate |
intermediate |
| Dead lift |
150 |
157 |
4,67% |
intermediate |
intermediate |
|


You can remove any link to our website from this website template, you're free to use this website template without linking back to us.
This website template hahs been designed by Free Website Templates for you, for free. You can replace all this text with your own text.
If you're having problems editing this website template, then don't hesitate to ask for help on the Forum.


#EXOvsXEXO trending number one worldwide as fans continue to rave over group's comeback concept
by sl278EXO is trending number one worldwide on Twitter as fans continue to rave about the group's unique concept trailer for their comeback release 'Obsession'.
This is the second day straight that group has hit worldwide trending, and fans continue to use a variety of hashtags to support the group in their first comeback after some members enlisted in the military. It seems as fans love the good versus evil concept as the EXO members go against each other in the concept trailer.
Are you looking forward to EXO's comeback?


Files CCore/inc/sys/SysSem.h CCore/src/sys/SysSem.cpp
This is to provide an OS backed semaphore.
#ifndef CCore_inc_sys_SysSem_h
#define CCore_inc_sys_SysSem_h
#include <CCore/inc/sys/SysError.h>
namespace CCore {
namespace Sys {
/* classes */
struct Sem;
/* struct Sem */
struct Sem
{
// private
....
// public
ErrorType init(ulen count=0) noexcept;
void exit() noexcept;
void give() noexcept;
void give_many(ulen count) noexcept;
bool try_take() noexcept;
void take() noexcept;
bool take(MSec timeout) noexcept;
};
} // namespace Sys
} // namespace CCore
#endif
To create a semaphore you create an instance of the structure Sem and initialize it. Then you use its methods to do semaphore operations. Finally, you uninitialize the instance. Copying of the instances is prohibited. The private content of the structure is target-dependent. Semaphore methods, except init(), do not produce errors. They must be successful or call abort. For example, it must abort on the counter overflow.
init() initialize the semaphore with the given counter value. The error code is returned. If the object is successfully initialized, it must be uninitialized by the method exit().
exit() uninitialize the semaphore.
give() "gives" the semaphore counter (i.e. increments it). It may release a thread, blocked on the semaphore.
give_many() "gives" the semaphore counter many times (i.e. increases it) by the given value. It may release multiple threads, blocked on the semaphore.
try_take() tries to "take" the semaphore, i.e. tries to decrement its counter. If the counter is not null, it is decremented and the true is returned. Otherwise the false is returned.
take() "takes" the semaphore (i.e. decrements its counter). If the counter is null, the calling thread is blocked until the operation becomes possible. The thread may be blocked infinitely.
take(MSec timeout) "takes" the semaphore (i.e. decrements its counter). But it blocks the calling thread up to the given timeout. If the semaphore was taken the method returns true. Otherwise the method returns false. It means the semaphore was not taken and the method call is finished because the timeout is expired.
Internally, Sem may contain only some "handle" and use global methods to deal with it:
struct Sem { // private data typedef int Type; Type handle; // private struct CreateType { Type handle; ErrorType error; }; static CreateType Create(ulen count) noexcept; static void Destroy(Type handle) noexcept; static void Give(Type handle) noexcept; static void GiveMany(Type handle,ulen count) noexcept; static bool TryTake(Type handle) noexcept; static void Take(Type handle) noexcept; static bool Take(Type handle,MSec timeout) noexcept; // public ErrorType init(ulen count=0) { CreateType result=Create(count); handle=result.handle; return result.error; } void exit() { Destroy(handle); } void give() { Give(handle); } void give_many(ulen count) { GiveMany(handle,count); } bool try_take() { return TryTake(handle); } void take() { Take(handle); } bool take(MSec timeout) { return Take(handle,timeout); } };


{% extends "base.html" %} {% block content %}
The Innovation University® is doing what it does best: reinventing the wheel. We are proud to present Gudarius: the world's first online mathematics teaching tool that works. The future of tomorrow is here today, for tomorrow: imagine.
We at Stevens Institute of Technology fully endorse the replacement of all mathematics professors with Gudarius. After all, why spend time learning math when you can spend time learning Gudarius?


Company profile - Canadian Company Capabilities
Third-Party Information Liability Disclaimer
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
New Centrade Inc. Import & Export
Legal Name:
New Centrade Inc. Import & Export
Operating Name:
New Centrade Inc.
Mailing Address:
29-2835 Goyer StMONTRÉAL, Quebec
H3S 1H2
Location Address:
29-2835 Goyer StMONTRÉAL, Quebec
H3S 1H2
Tel.:<PHONE_NUMBER>
Fax:<PHONE_NUMBER>
Company Profile
New Centrade Inc. Import & Export, situated in Montreal, Canada, is well established and successful world-wide supplier of organic products. We have established long-term business and personal relationships with companies throughout the world. Our long-term commitment to the organic product field and to our customers and suppliers is made possible through our experiences and belief in honesty and long-standing business relations.
We have committed our energies to providing the world market with good quality, non-genetically modified (GMO) products. We have contracted with farms in China and farms in Canada to sell organic products directly to North America and European countries.
Our farms have been certified since 1995. We have an intimate relationship with farmers and growers. Our people work on the farms to aid and advise the growers in agricultural practices. The farms we selected to contract with us are finely
suitable to meet organic certification program. The farmers grow the crops in harmony with nature by using sustainable
agricultural and environmental, friendly farming practices. The compost is made from the livestock and excess crops. It is applied to the soil after it has been completely fermented. All the weeds are controlled by careful hands picking or plough. The cleaning facilities and warehouses are up to the international standards.
Our company distributes the best natural, organic and ecologically sound products from the producers. We have many
items including organic soy beans, Natto beans, mung beans, kidney beans, sesame seeds, buckwheat, wheat, corn, brown rice, rice flour, and peanuts, alfalfa, peas, sunflower seeds, pumpkin seed kernels, brown flax, hemp seeds, feed soybeans and soybean meals and etc. We also have organic frozen vegetables, Edamame ( green soybeans) and strawberries. All these products, certified by ECOCERT-NOP and JAS can be traced back to the original farms. Organic processing factory has HACCP certificate and USA FPA-SAFE( Food Excellence Program) certificate. Our products are highly recognized as the best quality in North America, Europe, and Japan.
With the development and increasing demands for organic products in the world, we would like to cooperate with all the colleagues who share and practice the mutual belief that honesty and reliability is important to everyone's success in the
international organic field on the basis of mutual benefit. We will provide our partners the best quality organic products with satisfied prices and good service.
We warmly welcome people in the organic circles to contact us at any time.
Full profile
Full profile
Contact information
Company description
413190 - Other Specialty-Line Food Wholesaler-Distributors
418310 - Agricultural Feed Wholesaler-Distributors
418320 - Seed Wholesaler-Distributors
Product / Service / Licensing
1, Soya beans are one of the biggest agricultural commodities
being exported from China. Currently most of the organic soya
beans are exported to Japan where the requirements for the
product quality is high. Our soya beans are planted in districts
with suitable climate, strong stalks, loging resistance, disease
resistance. The weight per 100 granule is 20-25g. The growth
period is 125 days.
Product : Chinese organic soya beans, crop 1998, certified by
OCIA
white hilum Tofu or soymilk type
graded to Canada #1, Cool, of natural odor
Size : 5.5mm- 6.8mm up (screening is usually)
14/64
Protein : 40% Min to 43% Max
Moisture : Less than 14%
Purity : 99%
Packing : In 30kg paper bag
666bags in one 20'FCL
2, Organic Mung beans, crop 1998, certified by OCIA :
Size : 3.5mm up
Moisture : Less than 14%
Germination : 97% up
Dead Beans : Less than 0.5%
Packing : In 30kg paper bag
666bags in one 20'FCL
3, Organic natural sesame seeds, crop 1998, certified by OCIA
Color : Yellow and white
Fat : 7% up
Moisture : 9%
Purity : 99%
Packing : In 35kg paper bag
4, Organic brown rice
Rice is a source of energy and naturally convenient foods in the
world. Brown rice retains more natural vitamins and minerals than
white rice, because it is unpolished with only the fibrous full
removed. Our brown rice is the finest quality. We mill each order
when it is received. This guarantees the cleanliness and
freshness of the product.
Specs:
Moisture : 14%
Split : 3%
Protein : 9.62%
Purity : 98%
Length : 5.07mm, width 2.95mm. Rate : 1.72
5, Organic peanuts hulled and unhulled
30-40 grains/100 grams hulled
40-50 grains/100 grams
50-60 grains/100 grams
Packing : In 25 kg paper bag
30-60 grains/100 grams unhulled
Packing : In 50 kg gunny bag
6, Organic buckwheat, hulled, above middle grains
Split : 3%
Purity : 99%
Packing : In 30 kg paper bag
Organic buckwheat hulled and unhulled, above middle grains
Packing : In 50 kg gunny bag
We also have organic split soybeans for feed, Alfalfa , mustard
peas, Chinese Rose Radish, sunflower seeds, green tea, jasmine
tea and etc.
All the above organic products are certified by OCIA. The
products are guaranteed quality.
wheat, buckwheat , wheat, corn , brown flax , organic IQF
vegetables, organic IQF green soybeans( Edemame )and etc.
Technology profile
Japan and United States for cleaning the products.
Market profile
Industry sector market interests:
- Wholesale/Retail
Third-Party Information Liability Disclaimer
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
Contacts
Contact information
Description
Company description
413190 - Other Specialty-Line Food Wholesaler-Distributors
418310 - Agricultural Feed Wholesaler-Distributors
418320 - Seed Wholesaler-Distributors
Products, services and licensing
Product / Service / Licensing
1, Soya beans are one of the biggest agricultural commodities
being exported from China. Currently most of the organic soya
beans are exported to Japan where the requirements for the
product quality is high. Our soya beans are planted in districts
with suitable climate, strong stalks, loging resistance, disease
resistance. The weight per 100 granule is 20-25g. The growth
period is 125 days.
Product : Chinese organic soya beans, crop 1998, certified by
OCIA
white hilum Tofu or soymilk type
graded to Canada #1, Cool, of natural odor
Size : 5.5mm- 6.8mm up (screening is usually)
14/64
Protein : 40% Min to 43% Max
Moisture : Less than 14%
Purity : 99%
Packing : In 30kg paper bag
666bags in one 20'FCL
2, Organic Mung beans, crop 1998, certified by OCIA :
Size : 3.5mm up
Moisture : Less than 14%
Germination : 97% up
Dead Beans : Less than 0.5%
Packing : In 30kg paper bag
666bags in one 20'FCL
3, Organic natural sesame seeds, crop 1998, certified by OCIA
Color : Yellow and white
Fat : 7% up
Moisture : 9%
Purity : 99%
Packing : In 35kg paper bag
4, Organic brown rice
Rice is a source of energy and naturally convenient foods in the
world. Brown rice retains more natural vitamins and minerals than
white rice, because it is unpolished with only the fibrous full
removed. Our brown rice is the finest quality. We mill each order
when it is received. This guarantees the cleanliness and
freshness of the product.
Specs:
Moisture : 14%
Split : 3%
Protein : 9.62%
Purity : 98%
Length : 5.07mm, width 2.95mm. Rate : 1.72
5, Organic peanuts hulled and unhulled
30-40 grains/100 grams hulled
40-50 grains/100 grams
50-60 grains/100 grams
Packing : In 25 kg paper bag
30-60 grains/100 grams unhulled
Packing : In 50 kg gunny bag
6, Organic buckwheat, hulled, above middle grains
Split : 3%
Purity : 99%
Packing : In 30 kg paper bag
Organic buckwheat hulled and unhulled, above middle grains
Packing : In 50 kg gunny bag
We also have organic split soybeans for feed, Alfalfa , mustard
peas, Chinese Rose Radish, sunflower seeds, green tea, jasmine
tea and etc.
All the above organic products are certified by OCIA. The
products are guaranteed quality.
wheat, buckwheat , wheat, corn , brown flax , organic IQF
vegetables, organic IQF green soybeans( Edemame )and etc.
Technology
Technology profile
Japan and United States for cleaning the products.
Market
Market profile
Industry sector market interests:
- Wholesale/Retail


This is a paragraph, shown in the Times New Roman font.
This is a paragraph, shown in the Arial font.
lifestyle anything in a paragraph


The notion of “government-as-a-platform” is based on the principle of “build-once, use many times”. It’s about breaking things down into smaller parts like building blocks. Each block does one job and it’s easy to connect the blocks together when building a service. In an inefficient organization, siloed groups build their own customized services from the ground up to suit their particular needs, and this would happen over and over. A better approach is to build common service building blocks only once, in a re-usable format, and then share these with one another. This accelerates service delivery, reduces costs and offers consistency.
The BC Government has identified twenty common building blocks, or service design patterns, including the following:
What is Notify?
The Notify design pattern will make it easier to keep citizens updated, by enabling services to send automated text messages or emails to their users.
How do I use it?
There are two ways government services can send notifications to users. You can do a simple integration with your web application or upload batches of messages. Here is the API usage for sending text or email message(s):
Sending a Message
To send an outgoing message, make an HTTP POST to this URI: /bcgov/Accounts/{AccountSid}/Messages
| Parameter | Description |
|---|---|
| To: | The destination SMS number or batch file upload |
How do I customize?
Just get the source code from our github repo. It's been made available in multiple programming languages. Make a clone and tag it with your changes and identifier.
Can I just plug and play?
We are currently working on developing a docker container.


Controls
Download
Created by
Pratyay Banerjee
Red
1
Green
0
Blue
.5
Freq
1
Amp
.5
Speed
.1
Scale
.0025


Falkon is a KDE web browser using the QtWebEngine rendering engine. It was previously known as QupZilla. It aims to be a lightweight web browser available through all major platforms.
Although falkon is now part of KDE, it can be installed without KDE (with the loss of kwallet functionality).
This package is known to build and work properly using an LFS-9.1 platform.
Download (HTTP): https://download.kde.org/stable/falkon/3.1/falkon-3.1.0.tar.xz
Download MD5 sum: 9255fb335d3ba361dea44b7b297ddf7d
Download size: 2.2 MB
Estimated disk space required: 60 MB (without optional dependencies)
Estimated build time: 2.2 SBU (Using parallelism=4)
extra-cmake-modules-5.67.0, qtwebengine-5.14.1
gnome-keyring-3.36.0, KDE Frameworks-5.67.0 and PySide2 for experimental Python plugins (compiling this from source is very slow).
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/falkon
Install falkon by running the following commands:
Unless you have installed both PySide2 and ki18n, remove the translations for the sample hellopython.py script:
rm -rf po/
Fix a missing include in Qt-5.14:
sed -i '/#include <QSettings>/a#include <QFile>' \ src/plugins/VerticalTabs/verticaltabsplugin.cpp
Now build the program:
mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ .. && make
To test the results, issue: make
test. All tests should pass. If any fail, the full
results will be in Testing/Temporary/LastTest.log
.
Now, as the root
user:
make install
If you have installed Pyside2 you
will want to examine the hellopython.py which is in the
scripts/
directory, and perhaps copy
it to your home directory.
-DBUILD_TESTING=OFF
: This will save a
little time and space by not building the test programs, use this
if you do not wish to run the test.
Last updated on 2020-02-18 15:55:17 -0600


{{ template "header" . }}
This volume attached to Vm {{ .Volume.AttachedTo }}, please detach before.
Are you sure you want to remove volume {{ .Volume.Path }}?


| Address |
A specification for a connection to an origin server. For simple connections, this is the server’s hostname and port. If an explicit proxy is requested (or no proxy is explicitly requested), this also includes that proxy information. For secure connections the address also includes the SSL socket factory, hostname verifier, and certificate pinner.class Address |
| Authenticator |
interface Authenticator |
| Cache |
Caches HTTP and HTTPS responses to the filesystem so they may be reused, saving time and bandwidth.class Cache : Closeable , Flushable |
| CacheControl |
A Cache-Control header with cache directives from a server or client. These directives set policy on what responses can be stored, and which requests can be satisfied by those stored responses.class CacheControl |
| Call |
A call is a request that has been prepared for execution. A call can be canceled. As this object represents a single request/response pair (stream), it cannot be executed twice.interface Call : Cloneable |
| Callback |
interface Callback |
| CertificatePinner |
Constrains which certificates are trusted. Pinning certificates defends against attacks on certificate authorities. It also prevents connections through man-in-the-middle certificate authorities either known or unknown to the application’s user. This class currently pins a certificate’s Subject Public Key Info as described on Adam Langley’s Weblog. Pins are either base64 SHA-256 hashes as in HTTP Public Key Pinning (HPKP) or SHA-1 base64 hashes as in Chromium’s static certificates.class CertificatePinner |
| Challenge |
An RFC 7235 challenge.class Challenge |
| CipherSuite |
TLS cipher suites.class CipherSuite |
| Connection |
The sockets and streams of an HTTP, HTTPS, or HTTPS+HTTP/2 connection. May be used for multiple HTTP request/response exchanges. Connections may be direct to the origin server or via a proxy.interface Connection |
| ConnectionPool |
Manages reuse of HTTP and HTTP/2 connections for reduced network latency. HTTP requests that share the same Address may share a Connection. This class implements the policy of which connections to keep open for future use.class ConnectionPool |
| ConnectionSpec |
Specifies configuration for the socket connection that HTTP traffic travels through. For https: URLs, this includes the TLS version and cipher suites to use when negotiating a secure connection.class ConnectionSpec |
| Cookie |
An RFC 6265 Cookie.class Cookie |
| CookieJar |
Provides policy and persistence for HTTP cookies.interface CookieJar |
| Credentials |
Factory for HTTP authorization credentials.object Credentials |
| Dispatcher |
Policy on when async requests are executed.class Dispatcher |
| Dns |
A domain name service that resolves IP addresses for host names. Most applications will use the system DNS service, which is the default. Some applications may provide their own implementation to use a different DNS server, to prefer IPv6 addresses, to prefer IPv4 addresses, or to force a specific known IP address.interface Dns |
| EventListener |
Listener for metrics events. Extend this class to monitor the quantity, size, and duration of your application’s HTTP calls.abstract class EventListener |
| FormBody |
class FormBody : RequestBody |
| Handshake |
A record of a TLS handshake. For HTTPS clients, the client is local and the remote server is its peer.class Handshake |
| Headers |
The header fields of a single HTTP message. Values are uninterpreted strings; use Request and Response for interpreted headers. This class maintains the order of the header fields within the HTTP message.class Headers : Iterable < Pair < String , String >> |
| HttpUrl |
A uniform resource locator (URL) with a scheme of either http or https . Use this class to compose and decompose Internet addresses. For example, this code will compose and print a URL for Google search:class HttpUrl |
| Interceptor |
interface Interceptor |
| MediaType |
An RFC 2045 Media Type, appropriate to describe the content type of an HTTP request or response body.class MediaType |
| MultipartBody |
An RFC 2387-compliant request body.class MultipartBody : RequestBody |
| MultipartReader |
Reads a stream of RFC 2046 multipart body parts. Callers read parts one-at-a-time until nextPart returns null. After calling nextPart any preceding parts should not be read.class MultipartReader : Closeable |
| OkHttp |
object OkHttp |
| OkHttpClient |
Factory for calls, which can be used to send HTTP requests and read their responses.open class OkHttpClient : Cloneable , Factory, Factory |
| Protocol |
Protocols that OkHttp implements for ALPN selection.enum class Protocol |
| Request |
An HTTP request. Instances of this class are immutable if their body is null or itself immutable.class Request |
| RequestBody |
abstract class RequestBody |
| Response |
An HTTP response. Instances of this class are not immutable: the response body is a one-shot value that may be consumed only once and then closed. All other properties are immutable.class Response : Closeable |
| ResponseBody |
A one-shot stream from the origin server to the client application with the raw bytes of the response body. Each response body is supported by an active connection to the webserver. This imposes both obligations and limits on the client application.abstract class ResponseBody : Closeable |
| Route |
The concrete route used by a connection to reach an abstract origin server. When creating a connection the client has many options:class Route |
| TlsVersion |
Versions of TLS that can be offered when negotiating a secure socket. See javax.net.ssl.SSLSocket.setEnabledProtocols.enum class TlsVersion |
| WebSocket |
A non-blocking interface to a web socket. Use the factory to create instances; usually this is OkHttpClient.interface WebSocket |
| WebSocketListener |
abstract class WebSocketListener |