Ant Installation
Download Apache Ant from its website: http://ant.apache.org/bindownload.cgi
Copy the archive file to /opt directory and extract it:
cd Downloads cp apache-ant-1.9.7-bin.tar.gz /opt cd /opt tar -xvf apache-ant-1.9.7-bin.tar.gz
Download Apache Ant from its website: http://ant.apache.org/bindownload.cgi
Copy the archive file to /opt directory and extract it:
cd Downloads cp apache-ant-1.9.7-bin.tar.gz /opt cd /opt tar -xvf apache-ant-1.9.7-bin.tar.gz
This guide is aimed at developers wanting to set up their development environment.
First, you should have a JDK-7 installed on your machine. If you have a JDK-8, JBoss AS 7.x will not start.
Then, in your .profile file, set the JAVA_HOME environment variable pointing to java installation.
To download JBoss 7 application server issue the following command on terminal:
wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.tar.gz
Untar the archive:
tar -xvf jboss-as-7.1.1.Final.tar.gz
Copy the directory to /opt/redhat-jboss-as-7:
sudo cp -r jboss-as-7.1.1.Final /opt/redhat-jboss-as-7
You don't want the jboss process to run as root on your machine, so you need to change the owner and owner group of jboss. Assume you are logged as the user max, to set the owner user and owner group on the jboss directory, issue the following command:
sudo chown -R max:max /opt/redhat-jboss-as-7
To start JBoss type on the shell:
max@ubuntu-host:/opt/redhat-jboss-as-7/bin$ ./standalone.sh
Install Java, see here
JAVA_HOME, CATALINA_HOME and PATH environment variablesThe JAVA_HOME variable is used by Java Servers such as Tomcat and JBoss.
The CATALINA_HOME variable is required by when running Tomcat from command line
to locate the files stored in $CATALINA_HOME/conf and $CATALINA_HOME/logs directories.
To set user environment variables edit the
~/.profile:
max@ubuntu-host:~$ nano ~.profile
Append the following lines to the ~.profile file:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle export CATALINA_HOME=/opt/apache-tomcat-8.0.38 export PATH=$PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin
By march 2019, Java SE 8 will go through the End of Public Updates process, because it is a legacy release.
The java programming language is an open source project. The OpenJDK community works for a free open-source implementation of the Java SE standard and Oracle contribute to the OpenJDK project. Beginning with Java SE 11 (September 2018, LTS), Oracle provide free releases and commercially supported releases for use with Oracle products: OpenJDK (free) and Oracle JDK (commercial) builds from Oracle. The OpenJDK project is the basis for both OpenJDK and Oracle JDK builds: applications will run interchangeably on Oracle JDK-11 and OpenJDK JDK-11.
jQuery selector working with forms are not always the fastest option to select elements: when you use them remember to reduce the number of elements jQuery needs to look through. Orthewise, use common CSS selectors
Example of use of jQuery selectors for forms
/* to start, select all form descendants,
then, use the filter() method on the initial selection */
var $formDescs = $('form *');
/* :input selects all button, input, select and textarea */
var $inputs = $formDescs.filter(':input');
/* :text selects input type="text" and input */
var $text = $inputs.filter(':text');
/* :password selects input type="password" */
var $password = $inputs.filter(':password');
/* :button selects button and input type='button' */
var $button = $inputs.filter(":button");
/* :checked selects all checked inputs from group of radio and check inputs */
var checked = $inputs.filter(":checked");
/* :selected selects all selected options from drop boxes */
var selected = $inputs.filter(":selected");
jQuery effects includes transitions and movements
| jQuery method | method meaning | |
|---|---|---|
| Basic Effects | $('selector').show() | set the display CSS property to element's default value |
| $('selector').hide() | set the display CSS property to none |
|
| $('selector').toggle() | toggle between showing and hiding elements | |
| Fading Effects | $('selector').fadeOut() | make element disappear by changing both opacity and display CSS properties |
| $('selector').fadeIn() | make element appear by changing both opacity and display CSS properties |
|
| $('selector').fadeTo() | change the opacity CSS property |
|
| $('selector').fadeToggle() | hide or show the element | |
| Sliding Effects | $('selector').slideUp() | hide the element with sliding movement |
| $('selector').slideDown() | show the element with sliding movement | |
| $('selector').slideToggle() | hide or show the element | |
| Custom Effects | $('selector').delay() | delay the execution of the following method |
| $('selector').stop() | stop the animation | |
| $('selector').animate() | create a custom animation |
The jQuery methods for traversing the DOM allow to access other element nodes relative to the initial selection.
| jQuery method | method meaning |
|---|---|
| $('selector').find('selector2') | all the elements in the current selection matching selector2 |
| $('selector').closest('selector2') | the nearest ancestral element matching selector2 |
| $('selector').parent() | the direct parent element of current selection |
| $('selector').parents() | all the parents of current selection |
| $('selector').children() | all the children of current selection |
| $('selector').next() | next sibling of current element |
| $('selector').prev() | previous sibling of current element |
The ready() method executes its function argument when the page is ready to work
$(document).ready(function(){
// function body
});
ready() method add a listener for DOMContentLoaded events or for load events (in browsers that do not support HTML5 events a load event is fired instead)There is a shorthand code for the ready() method:
$(function(){
// function body
});
If you do not wish to use jQuery but still run your code when the page is ready to work, place your script before the body closing tag.
The .html() and .text() methods retrive and update the content of elements.
| jQuery method | method meaning |
|---|---|
| html = $('selector').html() | get the HTML content of the first element in the jQuery selection |
| text = $('selector').text() | get the textual content from every element in the jQuery selection and any descendant |
jQuery is a javascript library you include in your web pages.
jQuery allows you to select elements using a CSS-style selector and do something with those elements by calling a jQuery method.
$('p'); /* a jQuery object */
$() works as short invocation to the jQuery() function$() creates a jQuery object which stores references to the selected elements
1 Selector Syntax
2 Simple Selectors
2.1 Type selector (or Tag selector)
2.2 Universal Selector
2.3 Attribute selector
2.4 Class (attribute) selector
2.5 ID (attribute) selector
2.6 Pseudo-classes
3 Pseudo Elements
3.1 The ::first-line pseudo-element
3.2 The ::first-letter pseudo-element
3.3 The ::before and ::after pseudo-elements
4 Combinators
4.1 Descendant combinator
4.2 Child combinators
4.3 Sibling combinators
5 Calculating a selector's specificity
Selector
A selector is one or more sequences of simple selectors separated by combinators, an optional pseudo-element may follow the last sequence of simple selectors
selector = sequenceOfSimpleSelectors [combinator1 sequenceOfSimpleSelectors1 ... ] [::pseudoElement]
A sequence of simple selectors
The subjects of a selector are the elements of a document tree that are represented by the selector.
A comma-separated list of selectors represents all elements selected by each selector in the list. In CSS, if several selectors share the same declarations, they may be grouped into a comma-separated list.
Example: three CSS rules are condensed into one
h1 { font-family: sans-serif }
h2 { font-family: sans-serif }
h3 { font-family: sans-serif }
is equivalent to:
h1, h2, h3 { font-family: sans-serif }